Return to Snippet

Revision: 7301
at July 18, 2008 04:16 by KernelPanic


Updated Code
function createXMLHttpRequestObject() {
	var resObject = null;
	
	try {
		resObject = new ActiveXObject("Mircosoft.XMLHTTP");
		window.console.log("Microsoft.XMLHTTP");
	}
	
	catch (error) {
		try {
			resObject = new ActiveXObject("MSXML2.XMLHTTP")
			window.console.log("MSXML2.XMLHTTP");
		}
		catch(error) {
			try {
				resObject = new XMLHttpRequest();
				window.console.log("XMLHttpRequest");
			}
			catch (error) {
				alert("XMLHttpRequest-Objekt konnte nicht erzeugt werden.");
			}
		}
	}
	
	return resObject;
}

Revision: 7300
at July 17, 2008 10:51 by KernelPanic


Initial Code
function createXMLHttpRequestObject() {
	var resObject = null;
	
	try {
		resObject = new ActiveXObject("Mircosoft.XMLHTTP");
		window.console.log("Microsoft.XMLHTTP");
	}
	
	catch (error) {
		try {
			resObject = new ActiveXObject("MSXML2.XMLHTTP")
			window.console.log("MSXML2.XMLHTTP");
		}
		catch(error) {
			try {
				resObject = new XMLHttpRequest();
				window.console.log("XMLHttpRequest");
			}
			catch (error) {
				alert("XMLHttpRequest-Objekt konnte nicht erzeugt werden.");
			}
		}
	}
	
	return resObject;
}

Initial URL

                                

Initial Description

                                

Initial Title
Create XMLHttpRequest

Initial Tags
ajax, textmate

Initial Language
JavaScript