当我使用Dean Edwards的IE7.js与IE6时,我如何处理以下错误? [英] How can I deal with the following error I get when I use Dean Edwards' IE7.js with IE6?

查看:140
本文介绍了当我使用Dean Edwards的IE7.js与IE6时,我如何处理以下错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Dean Edwards的IE7.js for IE6

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

并在IE 6读取该行时收到JavaScript错误:

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?

推荐答案

我不相信IE6有一个parentElement属性。您可以通过在<! - [if lt ie7]> 标记中包含此代码来解决此问题:

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;

这篇关于当我使用Dean Edwards的IE7.js与IE6时,我如何处理以下错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆