IE8:Object不支持此属性或方法 [英] IE8: Object doesn't support this property or method
问题描述
我知道我的问题已知,我无法找到解决问题的方法。
但是代码适用于chrome,ff和safari,但不适用于ie6-8。
我试图调试代码并弹出如下:
行:272
错误:对象不支持此属性或方法
I know that my issue is known, I just can't figure out a way to fix the problem. However the code works in chrome,ff and safari, but not in ie6-8. I tried to debug the code and following popped up: Line: 272 Error: Object doesn't support this property or method
这是我的js文件中的第272行
This is line 272 from my js-file
$('#page1')[0].addEventListener('webkitAnimationEnd', self.webkitAnimationEnd, true);
你知道它有什么问题吗?我正在使用jquery < script type =text / javascriptsrc =js / jquery-1.4.3.min.js> ;;< / script>
在我的.html文件中调用。
Hav you got an idea what is wrong with it? I'm using jquery <script type="text/javascript" src="js/jquery-1.4.3.min.js">;</script>
which is called in my .html file.
我感谢任何帮助或有用的提示。
提前谢谢。
I appreciate any help or useful hint. Thank you in advance.
推荐答案
使用 attachEvent
这里的IE是一个SO链接 Javascript中的MSIE和addEventListener问题?
您的代码可能如下所示
if ( $.browser.msie ) {
$('#page1')[0].attachEvent('webkitAnimationEnd', self.webkitAnimationEnd);
}
希望这会有所帮助
这篇关于IE8:Object不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!