ActiveXObject对象是用来启用并返回Automation对象的,也可以理解为浏览器插件,ActiveXObject只支持IE。
利用ActiveXObject创建XMLHttpRequest对象
var xmlhttp = new ActiveXObject("
MSXML2.XMLHTTP.4.0
");//创建XMLHttpRequest对象
xmlhttp.open("GET",url,false,"","") //open(Method,url,Async,user,password)方法属性1、传送方式 2、url地址 3、同步异步配置,默认为true同步 4、5分别为用户和密码
xmlhttp.send("");
return xmlhttp.responseText;