简体   繁体   English

Flexslider和IE8对象不支持此属性或方法

[英]Flexslider and IE8 Object doesn't support this property or method

I am getting an error in IE8 "Object doesn't support this property or method" and my Flexslider is not running the script. IE8中出现错误“对象不支持此属性或方法”,我的Flexslider没有运行脚本。 I've looked through all of the similarly asked questions and double checked their solutions such as checking for trailing commas, removing 'defer' from the flexslider.js call, proper HTML and DOM calls, and made sure that jQuery is only being called once on the page. 我仔细研究了所有类似的问题,并仔细检查了它们的解决方案,例如检查尾随逗号,从flexslider.js调用中删除“ defer”,正确的HTML和DOM调用,并确保jQuery仅被调用一次在页面上。

There is a handful of other scripts being called before this so I moved it to before them, no avail. 在此之前,还有一些其他脚本被调用,因此我将其移至它们之前,但无济于事。 Then tried removing the other scripts completely so that only jQuery and Flexslider are being called, which means it isn't a conflict between seperate scripts. 然后尝试完全删除其他脚本,以便仅调用jQuery和Flexslider,这意味着单独的脚本之间没有冲突。

Here is the code. 这是代码。

<script src="/js/jquery.flexslider.js"></script>
<script type="text/javascript">
  $( document ).ready(function() {
    $('.flexslider').flexslider();
  });
</script>

The line causing the error is $('.flexslider').flexslider(); 导致错误的行是$('.flexslider').flexslider();

Maybe I've just been looking at this for too long and I'm missing something obvious, but this solution is evading me. 也许我只是在看这太久了,而我却遗漏了一些明显的东西,但是这种解决方案使我无所适从。

You can view the development site here for right now (link removed, issue has been fixed). 您现在可以在此处查看开发站点(链接已删除,问题已修复)。

UPDATE: I removed the 'defer' from the flexslider.js call and it is now erroring out in all browsers, re-adding the defer when calling it fixes the issue for modern browsers, but might be why it cannot be loaded in IE8. 更新:我从flexslider.js调用中删除了“ defer”,现在它在所有浏览器中都出错,在调用它时重新添加了defer ,解决了现代浏览器的问题,但这可能就是为什么它无法在IE8中加载的原因。

For the sake of formality 为了手续

IE doesn't handle duplicate javascript references as well as other mainstream browsers, from looking at the testing site, you can see two references to jquery.tools . IE不会处理重复的javascript引用以及其他主流浏览器,从测试站点来看,您可以看到对jquery.tools两个引用。 This may very be causing the annoying error. 这可能会引起恼人的错误。

Hope this helped. 希望这会有所帮助。 (Looks like it did) (看起来确实如此)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM