Created
March 24, 2016 19:47
-
-
Save leandroh/56310a43bd9bf55ee3c1 to your computer and use it in GitHub Desktop.
XHR is a mess!
This file contains 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
if (window.XMLHttpRequest) { | |
request = new XMLHttpRequest(); | |
} else if (window.ActiveXObject) { | |
try { | |
request = new ActiveXObject('Msxml2.XMLHTTP'); | |
} | |
catch (e) { | |
try { | |
request = new ActiveXObject('Microsoft.XMLHTTP'); | |
} | |
catch (e) {} | |
} | |
} | |
request.open('GET', 'https://api.github.com/users/leandroh', true); | |
request.send(null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment