I have some Javascript on a webpage which works fine in Chrome and Firefox; when testing in IE 11 however it fails. I viewed the problem in IE 11 with the debug tools (F12) and the following code was at fault; specifically when using parseFromString a 'Syntax Error' is thrown:
if (window.DOMParser)
{
parser = new DOMParser();
tmp = parser.parseFromString(resp, "text/xml");
}
Any way I can work around this?
For IE this works for me
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(text);
source: http://www.w3schools.com/dom/dom_parser.asp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With