javascript – IE8正在抛出jQuery错误

前端之家收集整理的这篇文章主要介绍了javascript – IE8正在抛出jQuery错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正面临着IE7 / IE8和jQuery的一些问题.我的代码适用于IE 10,FF,Chrome,Safari,Mobile Safari,Mobile Chrome.

现在,为了调试,我删除了自己的JS文件.所以这是代码

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

页面上没有引用其他JS.我删除了所有其他JS引用,并且页面本身没有执行JS.当页面在IE8中加载时,我收到此错误

Line: 4
Error: Object doesn't support this property or method

调试器显示上述内容.不确定问题出在哪里.任何帮助是极大的赞赏.

附: – 这是我第一次“认真”的网络开发工作,我现在看到为什么IE在开发社区中被如此讨厌.

解决方法

jQuery 2.0放弃了对某些浏览器的支持.请参阅 http://blog.jquery.com/2013/04/18/jquery-2-0-released/发布的帖子

从帖子引用:

No more support for IE 6/7/8: Remember that this can also affect IE9
and even IE10 if they are used in their “Compatibility View” modes
that emulate older versions. To prevent these newer IE versions from
slipping back into prehistoric modes,we suggest you always use an
X-UA-Compatible tag or HTTP header. If you can use the HTTP header it
is slightly better for performance because it avoids a potential
browser parser restart.

Reduced size: The final 2.0.0 file is 12 percent smaller than the
1.9.1 file,thanks to the elimination of patches that were only needed for IE 6,7,and 8. We had hoped to remove even more code and increase
performance,but older Android/WebKit 2.x browsers are now the weakest
link. We’re carefully watching Android 2.x market share to determine
when we can cross it off the support list,and don’t expect it to take
very long.

保持jQuery 1.9(编辑2015-11-17:jQuery 1.11.3是jQuery的当前1.x版本.)如果IE 6/7/8是一个问题.

猜你在找的jQuery相关文章