How can I deal with the following error I get when I use Dean Edwards' IE7.js with IE6?

淺唱寂寞╮ 提交于 2019-12-11 10:14:40

问题


I'm using Dean Edwards' IE7.js for IE6

<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" 
        type="text/javascript"></script>
<![endif]-->

and getting a JavaScript error on IE 6 when it reads the line:

c.runtimeStyle[h]=c.parentElement.currentStyle[h]

How can I solve this?


回答1:


I don't believe IE6 has a parentElement property. You might be able to get around this by including this code in the <!--[if lt ie7]> tag:

Element.prototype.parentElement = Element.prototype.parentNode;


来源:https://stackoverflow.com/questions/1774519/how-can-i-deal-with-the-following-error-i-get-when-i-use-dean-edwards-ie7-js-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!