After exploring various AJAX libraries, I have noticed that XMLHttpRequest typically involves a lengthy declaration with testing or try/catch statements.
I am trying to fetch XML through a SOAP GET request and found success in testing the following declaration across IE7+, Firefox, and Chrome:
var xhr=new XMLHttpRequest()||new ActiveXObject("Microsoft.XMLHTTP");
Is there something crucial that I may be overlooking? Are there any edge cases that could potentially cause my declaration to fail?
Edit
It appears that the second part of the declaration is never executed. Does this mean that for IE7+/Firefox/Chrome, all I really need is:
var xhr=new XMLHttpRequest();