/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Returns a HttpRequest object */ function getHTTPObject() { try { // Opera 8.0+, Firefox, Safari return new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } }