admin管理员组文章数量:1278886
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 mon 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?
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 mon 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?
Share Improve this question edited May 23, 2017 at 12:30 CommunityBot 11 silver badge asked May 29, 2013 at 8:47 L. SannaL. Sanna 6,5627 gold badges35 silver badges47 bronze badges 6- 1 Did you include the JQuery? Backbone's fetch() method is delegated to the $.ajax() method. if ajax can't be found on some object, it must be $ is missing. – Hetfield Joe Commented May 29, 2013 at 8:53
- I wondered about that too. But why does it work in chrome then? – L. Sanna Commented May 29, 2013 at 8:56
- On IE9 hit F12 and go to the console, type "$". result is? – Hetfield Joe Commented May 29, 2013 at 9:03
- so JQuery is not loaded, try to clear the cache of IE, and check out the configuration about javascript. – Hetfield Joe Commented May 29, 2013 at 9:20
-
is it work on other browsers? if it works I don't know what's your problem, else it doesn't work then you need to change inside
fetch
, because it returned something (like json) – Ulug'bek Commented May 29, 2013 at 12:09
2 Answers
Reset to default 6OK, I found the problem:
IE9 was rendering the page in patibility mode.
I added
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
as the very first line of the header, and now it works.
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
本文标签:
版权声明:本文标题:javascript - IE9 error: SCRIPT5007: Unable to get value of the property 'ajax': object is null or undefined - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741240629a2363903.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论