I read countless streams and tried to implement many different sentences, but had no luck.
first:
function ajaxRequest() { try { var request = new XMLHttpRequest(); } catch(e1) { try { var request = new ActiveXObject("Msxml2.HTMLHTTP"); } catch(e2) { try { var request = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e3) { var request = false; } } } return request; }
It looks like IE is successfully using XMLHttpRequest. As far as I can tell, it loads XML perfectly, but Xpath is another story:
function XMLPath(doc, path) { try { return doc.evaluate(path, doc, null, XPathResult.STRING_TYPE, null).stringValue; } catch (e) { try { doc.setProperty("SelectionLanguage", "XPath"); return doc.selectNodes(path); } catch(e2) { alert(e2); } }
}
Basically, what should I change in my catch statement to make it work with IE? What is also interesting is that it never warns about an e2 error, which means that it is actually not an error. Totally embarrassed.
Thanks.
source share