IE9错误:SCRIPT5007:无法获取属性“AJAX”的值:对象为null或未定义 [英] IE9 error: SCRIPT5007: Unable to get value of the property 'ajax': object is null or undefined

查看:3569
本文介绍了IE9错误:SCRIPT5007:无法获取属性“AJAX”的值:对象为null或未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题

我试图把地图上的一个网页,该数据是获取与阿贾克斯。它正常工作与所有浏览器,但不是IE9。

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.

我得到一个错误:

SCRIPT5007:无法获取属性AJAX的值:对象为null或未定义

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

和地图不会加载。

的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();
           }});

我试过

这似乎是一个很常见的问题,<一个href="http://stackoverflow.com/questions/5787245/ie9-javascript-error-script5007-unable-to-get-value-of-the-property-ui-obje">here关于这个问题的最投票问题。所以,我试图把

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.

我的提问

我,我应该做些什么来解决这个问题?

What I should I do to fix this problem?

推荐答案

OK,我发现这个问题:

OK, I found the problem:

在IE9呈现页面在兼容模式下。

IE9 was rendering the page in compatibility mode.

我添加

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

作为标题的第一行,而现在它的作品。

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

这篇关于IE9错误:SCRIPT5007:无法获取属性“AJAX”的值:对象为null或未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆