所有浏览器都支持querySelector吗? [英] Is querySelector supported by all browsers?
问题描述
我想知道所有浏览器都支持 querySelector 吗?是不是它的替代使用?
I would like to know is querySelector supported by all browsers? is not what's alternate for it to use?
我已经测试了它与IE8,FF3,Chrome 4.它的罚款为我。我没有旧的浏览器。所以我想知道旧的浏览器是否会给我带来问题。
I have tested it with IE8, FF3, Chrome 4. Its fine for me. I do not have old browsers. So i would like to know if old browsers will give problem to me or not?
推荐答案
IE7<不支持它和IIRC IE8有命名空间的问题。至少有一个更深奥的浏览器有重大问题,但我不记得它是什么。
IE7< don't support it and IIRC IE8 has issues with namespaces. There's at least one more esoteric browser out there with major issues but I don't recall which it is.
基本上没有统一的基于表达式的DOM方法,绝对你最好的选择是使用库(无处不在的使用jquery答案,但你至少应该查看 Sizzle 如果你有大图书馆的问题),因为滚动自己的是比合理值得的努力(我从经验中说)。
Basically there is no unified expression-based DOM method, and absolutely your best bet is to use a library (the ubiquitous "use jquery" answer, but you should at least check out Sizzle if you have a problem with large libraries) because rolling your own is more effort than reasonably worthwhile (I speak from experience).
这篇关于所有浏览器都支持querySelector吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!