Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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