Skip to content

Instantly share code, notes, and snippets.

@65
Created March 11, 2012 07:59
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 65/2015510 to your computer and use it in GitHub Desktop.
Save 65/2015510 to your computer and use it in GitHub Desktop.
AJAX in IE7 and its so called native xmlhttp
var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
if (isAjaxEnabled()){ $.AjaxCFC({ url: "/org/sixfive/ajax/doLovelyAjax.cfc", .... }
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