This article mainly introduces JavaScript to create Createxmlhttprequest Object sample code. Need friends can come to the reference, I hope to help you.
Code as follows: var xmlHttp; function createxmlhttprequest () { if window. XMLHttpRequest) { xmlhttp=new XMLHttpRequest (); &nbs P if (xmlhttp.overridemimetype) &N Bsp { Xmlhttp.overridemimetype ("Text/xml"); &NBSP ; { } else if window. ActiveXObject) { try &NB Sp { xmlhttp=new ActiveXObject ("msxml2.xmlhttp"); catch (e) &NBSp { xmlhttp=new ActiveXObject ("Microsoft.XMLHTTP"); &n bsp; } if (!XMLHT TP) { Window.alert ("Your browser does not support creating XMLHttpRequest objects"); &N Bsp } return xmlHttp; }