【问题标题】:IE hanging on js errorsIE挂在js错误上
【发布时间】:2011-03-07 21:22:31
【问题描述】:

页面在 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 网址: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

谢谢!

【问题讨论】:

    标签: jquery jquery-plugins javascript simplemodal


    【解决方案1】:

    您需要确保任何操纵 DOM 的 Javascript (jQuery) 发生在 documentready() 事件中。

    在您的 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>
    

    【讨论】:

    • 如果我添加 doc.ready 函数,模式会在页面加载时弹出,这是不正确的行为。我想要在鼠标点击时打开模式的链接。当然,它在 FF 和 chrome 中运行良好,但在 IE 中不行。
    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      刚刚遇到这个问题,使用了一个保留的 JS 字,而 IE 抛出了这个错误。 :|希望对您有所帮助!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-10-25
        • 1970-01-01
        • 1970-01-01
        • 2021-10-25
        • 1970-01-01
        • 2010-09-09
        相关资源
        最近更新 更多