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

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

问题描述

我的问题

我正在尝试将地图放在网页上,正在使用 Ajax 获取数据.它适用于所有浏览器,但不适用于 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"的值:对象为空或未定义

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

并且地图无法加载.

代码

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

我尝试了什么

这似乎是一个很常见的问题,此处 是有关该主题的投票最多的问题.所以我试着把

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?

推荐答案

好的,我发现问题了:

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"的值:对象为空或未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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