在ie8浏览器中使用jquery-2.0.3:object不支持此属性或方法

时间:2022-06-15 18:04:42

I used jquery. It work fine in firefox. But when I open it by ie8 get same error : object dosn't suport this property or method . line 834 I disable this line and find same errors in this lines: 836,3316,...

我用jquery。它在Firefox中运行良好。但是当我通过ie8打开它时会得到同样的错误:object dos not suport this property or method。第834行我禁用此行并在此行中找到相同的错误:836,3316,...

I make sample code and test ,It not show my alerts never:

我制作示例代码并测试,它从不显示我的警报:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
<script type="text/javascript" src="jscripts/jquery-2.0.3.js"></script>
<script type="text/javascript" >

    var isIE8 = $.browser.msie && +$.browser.version === 8;
var isIE8 = $.browser.msie && +$.browser.version === 8;
if ( isIE8 ) {
alert("ie8");}


alert("test");
...

Can everyone help me? Thank you!

大家可以帮助我吗?谢谢!

2 个解决方案

#1


9  

As noted in the comments, jQuery 2.x " does not support Internet Explorer 6, 7, or 8"

如评论中所述,jQuery 2.x“不支持Internet Explorer 6,7或8”

From http://api.jquery.com/jQuery.browser/:

来自http://api.jquery.com/jQuery.browser/:

This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.

此属性已在jQuery 1.9中删除,只能通过jQuery.migrate插件获得。请尝试使用功能检测。

#2


3  

http://blog.jquery.com/2013/04/18/jquery-2-0-released/

http://blog.jquery.com/2013/04/18/jquery-2-0-released/

How 2.0 Changed

2.0如何改变

Here are some highlights of the changes that jQuery 2.0 brings:

以下是jQuery 2.0带来的变化的一些亮点:

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.

不再支持IE 6/7/8:请记住,如果它们用于模拟旧版本的“兼容性视图”模式,这也会影响IE9甚至IE10。为防止这些较新的IE版本重新回到史前模式,我们建议您始终使用X-UA兼容标签或HTTP标头。如果您可以使用HTTP标头,那么性能稍好一些,因为它可以避免潜在的浏览器解析器重启。

#1


9  

As noted in the comments, jQuery 2.x " does not support Internet Explorer 6, 7, or 8"

如评论中所述,jQuery 2.x“不支持Internet Explorer 6,7或8”

From http://api.jquery.com/jQuery.browser/:

来自http://api.jquery.com/jQuery.browser/:

This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.

此属性已在jQuery 1.9中删除,只能通过jQuery.migrate插件获得。请尝试使用功能检测。

#2


3  

http://blog.jquery.com/2013/04/18/jquery-2-0-released/

http://blog.jquery.com/2013/04/18/jquery-2-0-released/

How 2.0 Changed

2.0如何改变

Here are some highlights of the changes that jQuery 2.0 brings:

以下是jQuery 2.0带来的变化的一些亮点:

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.

不再支持IE 6/7/8:请记住,如果它们用于模拟旧版本的“兼容性视图”模式,这也会影响IE9甚至IE10。为防止这些较新的IE版本重新回到史前模式,我们建议您始终使用X-UA兼容标签或HTTP标头。如果您可以使用HTTP标头,那么性能稍好一些,因为它可以避免潜在的浏览器解析器重启。