getElementsByClassName

getElementsByClassName

本文介绍了document.getElementByClassName - 跨浏览器修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经查看过以前在document.getElementByClassName的跨浏览器修复程序中寻求帮助并找到提供了一个看似完美的修复。

I have looked at previous asks for help in a cross browser fix for document.getElementByClassName and found this link which provided a seemingly perfect fix.

但是我已经尝试在我构建的网站上实现它但无法在IE8(我正在工作的浏览器)上运行(或任何其他工具)以获得兼容性。
我仍​​然得到对象或属性不受支持错误,意味着该修复显然无法正常工作。

However I have tried implementing it on a site that I have built but can not get the fix to work (or any others) on IE8 (the browser which I am working to get compatability with).I am still getting the "Object or Property is not supported" error meaning that the fix is obviously not working.

因为任何原因导致此错误可能无法正常工作,无法找到任何有问题的人开始工作我问你是否能够帮助我解决这个问题。

Coming up short for any reasons why this may not be working correctly and unable to find anyone with problems getting it to work I ask if you would be able to help me in getting this fix working.

网站I我正在尝试修复工作是

The site I am trying to the fix working on is http://lifeswitch.org.nz.s125738.gridserver.com/

推荐答案

您已经创建了一个名为 getElementsByClassName ,而不是文档对象上的方法。您需要调用 getElementsByClassName window.getElementsByClassName ,而不是 document.getElementsByClassName

You have created a global function called getElementsByClassName, not a method on the document object. You need to call getElementsByClassName or window.getElementsByClassName, not document.getElementsByClassName.

这篇关于document.getElementByClassName - 跨浏览器修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 09:14