Created
December 26, 2014 19:16
-
-
Save devdays/25238542803fd5a57efe to your computer and use it in GitHub Desktop.
Single Page App - Checking Connection using XMLHttpRequest and on IE6
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
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