IE6已终止操作问题的2种情况及解决_javascript技巧

WBOY
Release: 2016-05-16 16:51:37
Original
971 people have browsed it

令人崩溃的IE6问题再次出现,打开某个页面时,弹出提示框“Internet Explorer无法打开Internet 站点...已终止操作”。 查了一下资料,感觉“因为js(一个比较复杂的js)写在body里面,在body元素加载完之前调用出现问题”的说法比较靠谱。

经过一番奋战,利用排除法解决了问题,共发现2种情况。

①原因:同一JS文件,先后引入2次。

解决:删除一个即可。

②原因:在body里直接调用JS文件中的方法。

解决:通过onload或jquery.ready事件,在页面加载完成后执行JS方法。

总结:应该是浏览器在解析JS的过程中,出现了使其崩溃的错误。

告诫自己:提示信息“Internet Explorer无法打开Internet 站点”说的很含糊,但我们应该认识到“页面中一定有错误代码(BUG)”,在没拿出认真态度去冷静分析、调试之前,不要一股脑把责任的推给浏览器(IE6)。

Related labels:
ie6
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!