Create a gist now

Instantly share code, notes, and snippets.

Compatible AJAX Object Initialization
function initAjax() {
var objXml = false;
if(window.XMLHttpRequest) {
objXml = new XMLHttpRequest(); // All modern browsers
} else if(window.ActiveXObject) {
try {
objXml = new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer 6
} catch(e) {
try {
objXml = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer 5
} catch(ex) {
objXml = false;
}
}
}
return ObjXml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment