IE9 error: SCRIPT5007: Unable to get value of the

2019-02-18 21:02发布

My problem

I'm trying to put a map on a webpage, the data being fetch with Ajax. It works fine with all browsers, but not IE9.

I get an error:

SCRIPT5007: Unable to get value of the property 'ajax': object is null or undefined

and the map does not load.

The code

       var mapModel = new Map(); 

       mapModel.get("leads").fetch({success: function(){ //error on this line
              var mapView = new MapView({ model: mapModel });
              $('body').append(mapView.el);
              mapView.render();
           }});

What I tried

This seems to be a very common issue, here is the most up-voted question on the subject. So I tried to put

 <meta http-equiv="X-UA-Compatible" content="IE=8"/>

but it didn't solve anything.

My question

What I should I do to fix this problem?

2条回答
forever°为你锁心
2楼-- · 2019-02-18 21:15

OK, I found the problem:

IE9 was rendering the page in compatibility mode.

I added

<meta http-equiv="X-UA-Compatible" content="IE=edge" >

as the very first line of the header, and now it works.

查看更多
贪生不怕死
3楼-- · 2019-02-18 21:31

Finally I solved this issue.

In my master page, there was a script manager. I replaced it with ToolkitScriptManager which is actually packaged with AjaxControlToolkit 4.0.

Now it works superbly.

Hope this might help someone

查看更多
登录 后发表回答