我正在使用 Diapo 滑块,它似乎在除了 Internet Explorer 8 之外的所有其他浏览器中都可以正常工作。
在运行 ie8 调试模式后,我收到以下错误:
SCRIPT438: 对象不支持“getElementsByClassName”属性或方法 prototype.js, 第5988行第5个字符
return function(className, parentElement) {
return $(parentElement || document.body).getElementsByClassName(className);
};
SCRIPT438: 对象不支持 'fireEvent' 属性或方法 prototype.js,第5736行字符7
if (document.createEvent)
element.dispatchEvent(event);
else
element.fireEvent(event.eventType, event);
return Event.extend(event);
我正在Magento平台上运行这个滑块,似乎问题出在prototype脚本上。它使用的prototype版本是1.7,所以不能通过升级脚本来解决问题。
注意:虽然我在IE9中没有显示问题,但我得到了以下错误:
SCRIPT438: 对象不支持“dispatchEvent”属性或方法 prototype.js,第5734行第7个字符
if (document.createEvent)
element.dispatchEvent(event);
else
element.fireEvent(event.eventType, event);
return Event.extend(event);
这些是 Diapo 滑块所需的脚本,在头部使用 script 标签加载。我不确定,但也许其中一些脚本与现有的脚本发生了冲突:
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/scripts/jquery.min.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.mobile-1.0rc2.customized.min.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.easing.1.3.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/scripts/diapo.js'></script>