IE挂在js上的错误

时间:2011-03-07 21:22:31

标签: jquery jquery-plugins javascript simplemodal

这个页面在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

谢谢!

3 个答案:

答案 0 :(得分:2)

您需要确保操纵DOM的任何Javascript(jQuery)都发生在document的{​​{3}}事件中。

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

答案 1 :(得分:1)

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

答案 2 :(得分:0)

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

相关问题