Ciao a tutti nella mia applicazione web ho previsto in alcune pagine con 2 select
e se viene attivata la prima popola tramite Ajax la 2a con i browser Firefox e Chrome funziona mentre con IE no come mai?? posto un esempio di codice
codice:
js
function GetXmlHttpObject(handler)
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function popola(url,project,sel)
{
if (url.length==0)
{
document.getElementById("txtResult").innerHTML="";
return;
}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
url=url+"?projectID="+project;
if (sel==document.getElementById("projectName")){
xmlHttp.onreadystatechange=stateChanged;
}
if (sel==document.getElementById("monProject")){
xmlHttp.onreadystatechange=stateChanged2;
}
if (sel==document.getElementById("monCostProject")){
xmlHttp.onreadystatechange=stateChanged3;
}
if (sel==document.getElementById("updateProject")){
xmlHttp.onreadystatechange=stateChanged4;
}
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
function stateChanged()
{
//alert("stateChanged");
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("projectrelease").innerHTML=xmlHttp.responseText;
}
else
{
// alert("Qui");
}
}
Grazie