为什么在firefox中就不好使哪? Web开发 CNETNews社区

 日期:2008-03-18 04时


var XmlHttp;
if(window.ActiveXObject){
XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
}else if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();
alert("asdfasdf");
}

function sendAJAX(par)
{
XmlHttp.Open("POST","receive.aspx" par,true);
XmlHttp.send();
XmlHttp.onreadystatechange=ServerProcess;
}


function ServerProcess()
{
if (XmlHttp.readystate==4 || XmlHttp.readystate=='complete')
{
document.getElementById("DropDownList1").style.display="";
var s=XmlHttp.responsetext;
var al=s.split(";");

document.all.DropDownList1.innerHTML="";
var op;
for(var i=0;i {
op=document.createElement("option");
op.innerText=al;
op.value=al;
document.all.DropDownList1.appendChild(op);
}
}
}

document.all.DropDownList1.innerHTML="";
这句话出了问题,document.all只在IE里面被支持
建议用document.getElementById("DropDownList1").innerHTML来替换

上一篇:超可爱S60 诺基亚N95粉色行货闪亮登场

下一篇:商业周刊困兽犹斗的诺基亚