Browser support for getElementsByTagNameNS

Which browsers / versions support getElementsByTagNameNS() and to what extent? I can not find a good link.

[Edit] I'm interested in the full link, but my immediate need is for an XML space with the names returned from an AJAX call (which jQuery does not seem to handle cue ball).

+4
source share
3 answers

The site indicates Firefox from version 1.5, Safari from version 3, and Opera from version 9.

In versions of Firefox earlier than 3.6, a case-insensitive search was performed, which, as corrected in version 3.6 .

Microsoft claims to support it as IE9. However, according to Dottoro , this is only true for HTML documents. I'm not sure that you cannot trust Dottoro, because the choice of namespace does not make sense for HTML documents anyway. You should be able to use XPath if getElementsByTagNameNS not supported. However, Wrappers are required because IE does not support the standard API - see Yaldex and NCZOnline for tips on how to get IE to work together. Or contact Microsoft Support.

I would recommend that XHTML documents really be processed with the XML content type when you plan to use this function in the DOM of a web page.

Chromium 14 also supports the method (and evaluates namespaces unlike older versions of Safari). Support may have been long before that, I just don't know the earliest version of Chrome / Chromium with support.

It seems that all browsers, but not IE, support DOM Level 3 XPath . Use XPath to replace calls with getElementsByTagNameNS if there is a problem with it. See NCZOnline for an introduction and notes on browser support.

+2
source

I know this is old, but it may be useful to someone. You can just use the plain old getElementsByTagName in IE. Instead of calling node.getElementsByTagNameNS('someNamespace', 'someNodeName') call node.getElementsByTagName('someNamespace:someNodeName') .

Or use the following pad:

 var getElementsByTagNameNS = function(node, ns, tagName) { if (node.getElementsByTagNameNS) { return node.getElementsByTagNameNS(ns, tagName); } return node.getElementsByTagName(ns + ':' + tagName); }; 

And name it as follows:

 getElementsByTagNameNS(someNode, 'someNamespace', 'someNodeName'); 
+2
source

Have you looked at this link ?

In particular, here .

0
source

Source: https://habr.com/ru/post/1384609/


All Articles