IE 因 js 错误而挂起

发布于 2024-10-20 15:19:57 字数 1055 浏览 2 评论 0原文

该页面在 IE 中挂起很长时间,但 Chrome/FF 可以直接通过它。

这是有问题的页面 http://174.120.239.48/~peakperf/

======= ======

网页错误详细信息

用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 6.1;WOW64;Trident/4.0;SLCC2;.NET CLR 2.0.50727;Media Center PC 6.0;.NET4.0C; .NET4.0E;.NET CLR 3.5.30729;.NET CLR 3.0.30729) 时间戳:2011 年 3 月 7 日星期一 21:18:49 UTC

消息:未实施 行

:432 字符:7 代码:0 URI:http://174.120。 239.48/~peakperf/wp-content/themes/strausberg/js/jquery.simplemodal-1.4.1.js

==========

这是js的pastebin: http://pastebin.com/xXaCK6XH

这是有问题的js: http://174.120.239.48/ ~peakperf/wp-content/themes/strausberg/js/jquery.simplemodal-1.4.1.js

谢谢!

The page hangs for a long time in IE but Chrome/FF power right through it.

Here's the page in question http://174.120.239.48/~peakperf/

=============

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6.0; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Mon, 7 Mar 2011 21:18:49 UTC

Message: Not implemented

Line: 432
Char: 7
Code: 0
URI: http://174.120.239.48/~peakperf/wp-content/themes/strausberg/js/jquery.simplemodal-1.4.1.js

==========

Here's the pastebin of the js:
http://pastebin.com/xXaCK6XH

Here's the js in question:
http://174.120.239.48/~peakperf/wp-content/themes/strausberg/js/jquery.simplemodal-1.4.1.js

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

左岸枫 2024-10-27 15:19:57

您需要确保任何操作 DOM 的 Javascript (jQuery) 发生在 ready() 事件中文档

在 HTML 中的多个位置,您会在解析脚本标记时修改 DOM。现在,如果您查看 IE 开发工具栏,您会注意到以下内容:

SCRIPT16385: Not implemented

jquery.simplemodal-1.4.1.js, line 432 character 7
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] terminating; too few slides: 0 
LOG: [cycle] terminating; zero elements found by selector 

我认为有问题的 Javascript 是:

<Script type="text/javascript">
jQuery(".basic").modal({overlayClose:true});
</script>

应该更改为:

<script type="text/javascript">
  jQuery(document).ready(function() {
    jQuery(".basic").modal({overlayClose:true});
  });
</script>

You need to make sure any Javascript (jQuery) that manipulates the DOM happens in the ready() event of the document.

In several places in your HTML, you're modifying the DOM right when the script tag gets parsed. Now, if you look in the IE dev toolbar, you'll notice the following:

SCRIPT16385: Not implemented

jquery.simplemodal-1.4.1.js, line 432 character 7
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] DOM not ready, queuing slideshow 
LOG: [cycle] terminating; too few slides: 0 
LOG: [cycle] terminating; zero elements found by selector 

I think the offending Javascript is:

<Script type="text/javascript">
jQuery(".basic").modal({overlayClose:true});
</script>

Which should be changed to:

<script type="text/javascript">
  jQuery(document).ready(function() {
    jQuery(".basic").modal({overlayClose:true});
  });
</script>
忘羡 2024-10-27 15:19:57

该网站表示 IE8 不支持该函数 (removeExpression),因为它已被弃用: http://help.dottoro.com/ljuvxilu.php

This website says that function (removeExpression) is not supported by IE8 as it is deprecated: http://help.dottoro.com/ljuvxilu.php

欲拥i 2024-10-27 15:19:57

刚刚遇到这个问题,正在使用保留的 JS 词,而 IE 抛出了这个错误。 :|希望有帮助!

Just ran into this issue, was using a reserved JS word and IE was throwing this error. :| Hope it helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文