注册 登录
编程论坛 ASP技术论坛

为什么这句话对firefox不起作用,该怎么改?使得ie和ff都起作用?

xinzheng 发布于 2008-06-18 13:09, 1342 次点击
function GetData(URL) {
var http = new ActiveXObject("MSXML2.XMLHTTP.3.0");
http.open("GET",URL,false);
http.send(null);
document.getElementById("nr").innerHTML= http.responseText;
}
4 回复
#2
yms1232008-06-18 13:12
firefox好像没有MSXML2.XMLHTTP.3.0这个组件
#3
hmhz2008-06-18 13:26
function GetData(URL) {
var http = false;
try {http = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {try {http = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e2) {http = false;}}
if (!http && typeof XMLHttpRequest != 'undefined') {http = new XMLHttpRequest();}
http.open("GET",URL,false);
http.send(null);
document.getElementById("nr").innerHTML=http.responseText;
}
#4
xinzheng2008-06-18 13:28
是的,可是不知道具体怎么用!!
这里有篇文章,谁能帮我看看我的问题!谢谢

http://www.
#5
xinzheng2008-06-18 13:31
[bo][un]hmhz[/un] 在 2008-6-18 13:26 的发言:[/bo]

function GetData(URL) {
var http = false;
try {http = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {try {http = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e2) {http = false;}}
if (!htt ...



十分感谢!!现在自己去找ie和ff对div显示不同的头痛问题去了!!!
1