Skip to content

Instantly share code, notes, and snippets.

@jalbertbowden
Forked from jed/LICENSE.txt
Created April 2, 2014 16:05
Show Gist options
  • Select an option

  • Save jalbertbowden/9937186 to your computer and use it in GitHub Desktop.

Select an option

Save jalbertbowden/9937186 to your computer and use it in GitHub Desktop.
function(
a // cursor placeholder
){
for( // for all a
a = 3; // from 3
a--; // to 0,
) try { // try
return new( // returning a new
this.XMLHttpRequest // XMLHttpRequest (w3c)
|| // or
ActiveXObject // ActiveXObject (MS)
)([ // reflecting
"Msxml2", // the
"Msxml3", // various
"Microsoft"][a] + // MS flavors
".XMLHTTP" // and appropriate suffix,
)
}
catch(e){} // and ignore when it fails.
}
function(a){for(a=3;a--;)try{return new(this.XMLHttpRequest||ActiveXObject)(["Msxml2","Msxml3","Microsoft"][a]+".XMLHTTP")}catch(e){}}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "getXHR",
"description": "get a supported XHR instance",
"keywords": [
"ajax",
"XHR",
"cross-browser",
"XmlHttpRequest"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment