如果使用 YUI 2.8,是否可以避免 IE 的区分大小写的 ID?
我在 IE 中使用 YAHOO.util.Dom.get 。
它似乎区分大小写,YUI(2.8)似乎无法处理。 FF 可让您获取 ID,而不会出现区分大小写的问题。我想知道是否有办法在 IE 中也能做到这一点。
此链接表示存在问题。但 YUI 能够解决这个问题吗?
I'm using YAHOO.util.Dom.get in IE.
It seems to be case sensitive and YUI (2.8) can't seem to deal with. FF lets you get ID's without case sensitivity issues. I was wondering if there is a way to also do it in IE.
This link says there is a problem. But has YUI been able to get around this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我为此做了一个快速测试。
http://tivac.com/yui2/giulio_id.htm
document.getElementById 是 IE 中不区分大小写 < 8. 应该是的,其他浏览器中都有。
YAHOO.util.Dom.get 在所有浏览器中IS 区分大小写。
I made a quick test for this.
http://tivac.com/yui2/giulio_id.htm
document.getElementById is NOT case-sensitive in IE < 8. It should be, it is in every other browser.
YAHOO.util.Dom.get IS case-sensitive in all browsers.
你用的是IE8吗?因为它区分大小写。我发现 YUI 开发人员不太可能围绕这样的事情进行编码。
无论如何,我不希望我的 ID 因区分大小写而有所不同,因为这样我很可能会复制并粘贴错误的 ID。只要花时间让你的 id 变得漂亮和干净,不用担心 YUI 是否有解决办法。
Are you using IE8? Because it is case sensitive. I find it unlikely that the YUI developers would code around something like this.
I would prefer to not have my ids differ by case sensitivity anyway, since I am likely to copy and paste the wrong one that way. Just take the time to make your ids nice and clean and don't worry about if YUI does or doesn't have a work around.