Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 26, 2014 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/25238542803fd5a57efe to your computer and use it in GitHub Desktop.
Save devdays/25238542803fd5a57efe to your computer and use it in GitHub Desktop.
Single Page App - Checking Connection using XMLHttpRequest and on IE6
var xmlHttp = null;
if (window.XMLHttpRequest) {
// If IE7, Mozilla, Safari, and so on: Use native object.
xmlHttp = new XMLHttpRequest();
}
else
{
if (window.ActiveXObject) {
// ...otherwise, use the ActiveX control for IE5.x and IE6.
xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment