Last active
December 23, 2015 17:19
-
-
Save zmiftah/6668020 to your computer and use it in GitHub Desktop.
Js : Create XHR Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getHTTPObject() { | |
if (typeof XMLHttpRequest != 'undefined') { | |
return new XMLHttpRequest(); | |
} | |
try { | |
return new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch (e) { | |
try { | |
return new ActiveXObject("Microsoft.XMLHTTP"); | |
} catch (e) {} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment