»
EnglishFrenchVietnamese

Print - Creating the XMLHTTPRequest Object - JavaScriptBank.com

Full version: jsB@nk » Ajax » Creating the XMLHTTPRequest Object
URL: https://www.javascriptbank.com/creating-the-xmlhttprequest-object.html

Creating the XMLHTTPRequest Object © JavaScriptBank.comMany browsers allow the XMLHTTPRequest object to be created directly. One method is to use this snippet. It tries all methods of creating the object until it discovers one that works.

Full version: jsB@nk » Ajax » Creating the XMLHTTPRequest Object
URL: https://www.javascriptbank.com/creating-the-xmlhttprequest-object.html



JavaScript
<script type=text/javascript>/*     This script downloaded from www.JavaScriptBank.com     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/// Created by: Phil Ballard :: http://www.crackajax.net/try {req = new XMLHttpRequest(); /* e.g. Firefox */} catch(e) {  try {    req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */  } catch (e) {    try {    req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */    } catch (E) {      req = false;    }  }}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->