What is the best way to create browser-independent Jscript code in which a DOMDocument has to be created?
I have this code (extracted from @MartinHonnen ‘s answer to my question How can make an XSLT Javascript extension function return a node-set?):
function tokenize (input) {
var doc = new ActiveXObject('Msxml2.DOMDocument.6.0');
...
}
which worked fine in an MSXML 6.0 XSLT processor (note that the Jscript is embedded in an xslt sheet) and in IE9 (although strangely enough not every time – stepping into debug mode seems to help a bit here), but didn’t do so good in IE8, where the class had to be changed to Msxml2.DOMDocument.3.0 to get it working properly. Apparently IE8 Jscript supports MSXML 3.0 but not higher versions.
So now I am looking for browser-type and browser-version independent code making use of DOMDocument.
Who can provide me with this?
I added Jquery as a tag because the best solution may be found there.
Side-question: where can I find an overview of which DOM class is supported by which browser type+version?
you need to tweak
CreateXmlHttpReqfunction to handle different types of Microsoft’s ActiveXObjectsReference:
https://stackoverflow.com/a/10389829/1237812