Created
March 11, 2012 07:59
-
-
Save 65/2015510 to your computer and use it in GitHub Desktop.
AJAX in IE7 and its so called native xmlhttp
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 xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); |
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
if (isAjaxEnabled()){ $.AjaxCFC({ url: "/org/sixfive/ajax/doLovelyAjax.cfc", .... } |
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
function isAjaxEnabled() { | |
var xml = true; | |
if(BrowserDetect.browser == "Explorer"){ | |
try { | |
var test = new ActiveXObject("Microsoft.XMLHTTP"); | |
// do not need to use ActiveXObject as this has already been assigned to XMLHttpRequest. | |
xml = true; | |
} catch (ex) { | |
xml = false; | |
} | |
} | |
return xml; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment