0

I am working on a project using OpenLayers. And I get the "Access is denied" error on IE only. I know there are some solutions to (maybe) easier problems:

SCRIPT5: Access is denied in IE9 on xmlhttprequest
Access denied to jQuery script on IE

But my restriction is that I cannot modify any library that I am using. But since this is a common problem, maybe OpenLayers has some solution ready and I just cannot find the right syntax to use it.

        var sundials = new OpenLayers.Layer.Vector("KML", {
            projection: map.displayProjection,
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "london_shapes.kml",
                format: new OpenLayers.Format.KML({
                    extractStyles: true,
                    extractAttributes: true
                })
            })
        });

        map.addLayers([wms]);
        map.addLayers([sundials]);//if you comment this, the error disappears
        //so it is obvious that the script cannot load london_shapes.kml under IE.

http://jsfiddle.net/dt1510/huepP/5/

Question: Is there an OpenLayers standard way to get rid of the IE problem?

EDIT: Here is a simpler demonstration of my problem:
The following web page works both in IE and Firefox: http://www.openlayers.org/dev/examples/kml-layer.html
However if I download it, it works only in Firefox, IE7 and not in IE8/IE9. I need the web page work when it is on the client's computer and not online.

Community
  • 1
  • 1
Dávid Natingga
  • 839
  • 3
  • 13
  • 30
  • No reply? OpenLayers is widely used library and many users still have IE browsers. There has to be some way out. I cannot believe that people would be modifying the libraries each time at the same sections and then recompiling them again... – Dávid Natingga Aug 29 '12 at 17:32
  • If it works from the webserver, but not the local machine, isn't the most likely point of failure IE's security settings? It would seem the code itself doesn't pose a problem. – invertedSpear Aug 29 '12 at 18:23
  • @invertedSpear Thanks for the suggestion. I tried to run the web page with minimal security settings and then also as an administrator. It does not seem to help. – Dávid Natingga Aug 29 '12 at 18:33
  • maybe then you do not have all the resources on your local machine (or have not updated all the references) and it is still making calls out to external sites, which could be causing some XSS violations. – invertedSpear Aug 29 '12 at 18:45
  • @invertedSpear XSS violations would not make it possible to execute the script on Firefox too. But on Firefox it works! – Dávid Natingga Aug 29 '12 at 19:37
  • If anybody else has the same problem by chance, I am bypassing this issue by loading the kml script into variable instead of loading it externally. – Dávid Natingga Sep 04 '12 at 21:45

1 Answers1

3

I solved it changing the jQuery library version 1.8.0 by 1.8.1

Derekthar
  • 533
  • 2
  • 12
  • 23
  • This worked for me with a unrelated issue as well. A simple $('
    '); seemed to be causing the same 'script5 access denied' issued in IE9 and an upgrade of jquery fixed it.
    – Zimzat Oct 20 '12 at 09:22
  • Me too, solved a similar issue by upgrading the jquery version 1.8.1 + – EastSw Jan 14 '14 at 05:17