Skip to content

Instantly share code, notes, and snippets.

@Chavao
Created February 29, 2012 18:29
Show Gist options
  • Save Chavao/1943339 to your computer and use it in GitHub Desktop.
Save Chavao/1943339 to your computer and use it in GitHub Desktop.
Old school AJAX object
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try { http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try { http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment