IE 因 js 错误而挂起
该页面在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要确保任何操作 DOM 的 Javascript (jQuery) 发生在 ready() 事件中
文档
。在 HTML 中的多个位置,您会在解析脚本标记时修改 DOM。现在,如果您查看 IE 开发工具栏,您会注意到以下内容:
我认为有问题的 Javascript 是:
应该更改为:
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:
I think the offending Javascript is:
Which should be changed to:
该网站表示 IE8 不支持该函数 (
removeExpression
),因为它已被弃用: http://help.dottoro.com/ljuvxilu.phpThis website says that function (
removeExpression
) is not supported by IE8 as it is deprecated: http://help.dottoro.com/ljuvxilu.php刚刚遇到这个问题,正在使用保留的 JS 词,而 IE 抛出了这个错误。 :|希望有帮助!
Just ran into this issue, was using a reserved JS word and IE was throwing this error. :| Hope it helps!