Skip to content

Instantly share code, notes, and snippets.

@ariunbat
Created April 11, 2013 15:24
Show Gist options
  • Save ariunbat/5364306 to your computer and use it in GitHub Desktop.
Save ariunbat/5364306 to your computer and use it in GitHub Desktop.
XHR wrapper
function createXHR(){
try {return new XMLHttpRequest();} catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e){}
try {return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment