/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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; }
Comments
