浏览器对getElementsByTagNameNS的支持 [英] Browser support for getElementsByTagNameNS

查看:392
本文介绍了浏览器对getElementsByTagNameNS的支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些浏览器/版本支持 getElementsByTagNameNS(),以及到哪个范围?我似乎找不到一个好的参考。

Which browsers/versions support getElementsByTagNameNS(), and to which extent? I can't seem to find a good reference.

我对一个完整的参考感兴趣,但我的直接需要是从AJAX调用返回的命名空间xml (其中jQuery似乎不处理btw)。

I am interested in a complete reference, but my immediate need is for namespaced xml returned from an AJAX call (which jQuery doesn't seem to handle btw).

推荐答案

Sitepoint说 Firefox版本1.5,Safari版本3和Opera版本9。

Sitepoint says Firefox as of version 1.5, Safari as of version 3 and Opera as of version 9.

Firefox版本低于3.6的情况下,不区分大小写的搜索,如更正版本3.6

Firefox versions lower than 3.6 did a case insensitive search which as corrected in version 3.6.

Microsoft声明支持它自IE9。但是,根据Dottoro ,这仅适用于HTML文档。我不知道你是否真的不能信任Dottoro,因为选择通过命名空间对于HTML文档无意义。
如果不支持 getElementsByTagNameNS ,则应该可以使用XPath。但是,由于IE不支持标准API,因此需要包装器 - 请参见 Yaldex < a>和 NCZOnline 提示如何得到IE的合作。或要求Microsoft的支持。

Microsoft claims to support it as of IE9. However, according to Dottoro, this is only true for HTML documents. I'm not sure if you can't really trust Dottoro because selecting by namespace does not make sense for HTML documents anyway. You should be able to use XPath if getElementsByTagNameNS is not supported. Wrappers are required, though, since IE does not support the standard API – see Yaldex and NCZOnline for hints how to get IE to cooperate. Or ask Microsoft's support.

我建议您在计划在网页的DOM上使用此功能时,建议确保XHTML文档实际上已经提供了XML内容类型

I would recommend to ensure XHTML documents have actually been served with a XML content type when you plan to use the function on the DOM of a web page.

Chromium 14也支持该方法(并且与旧的Safari版本形成对比的是命名空间)。支持可能早已存在,我只是不知道最早的Chrome / Chromium版本支持。

Chromium 14 does also support the method (and honors namespaces in contrast to old Safari versions). Support might have been in long before, I just don't know the earliest Chrome/Chromium version with support.

似乎所有浏览器,但没有IE支持 DOM Level 3 XPath 。如果有问题,请使用XPath替换对 getElementsByTagNameNS 的调用。有关简介,请参见 NCZOnline 浏览器支持注意事项。

It seems all browsers but not IE are supporting DOM Level 3 XPath. Use XPath to replace calls to getElementsByTagNameNS if there are issues with it. See NCZOnline for an introduction and notes on browser support.

这篇关于浏览器对getElementsByTagNameNS的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆