1

由于我用wordpress制作网站,这是IE7和IE8中未显示的jquery影响部分,阅读浏览器错误,它显示:对象不支持此方法:'getElementsByClassName',在这种情况下,我在header.php中添加以下代码:

<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9"/>

并证明浏览器版本的合理性:

<!--[if lt IE 8]>
<script src="<?php echo get_template_directory_uri(); ?>/js/wow.js"></script>
<![endif]-->

<!--[if IE 8]><script src="<?php echo get_template_directory_uri(); ?>/js/wow_ie8.js"></script><![endif]-->



 <!--[if !IE]><!--><script src="<?php echo get_template_directory_uri(); ?>/js/wow.js"></script><!--<![endif]-->

而对于js文件部分:
我只是改变

哇.js

代码到

wow_ie8.js

this.boxes = this.element.getElementsByClassName(this.config.boxClass);

到这段代码:

 this.boxes = this.element.querySelectorAll(this.config.boxClass);

不知何故,网站仍然显示错误:对象不支持此方法:'getElementsByClassName'

有没有人可以给我解决这个问题的解决方案?十分感谢!!

4

0 回答 0