Salve, ho una funzione che mi gestisce un file xml ma funzione solo su firefox e non vuole funzionare sugli altri browser. Il problema sta solo nella gestione del file xml!!
codice:
function start(){
createAjaxRequest();
objectRequest.onreadystatechange = handleStateChange;
objectRequest.open("GET", path, true);
objectRequest.send(null);
}
function createAjaxRequest(){
if( window.ActiveXObject ){
objectRequest = new ActiveXObject( "Microsoft.XMLHTTP" );
}
else if( window.XMLHttpRequest ){
objectRequest = new XMLHttpRequest();
}
}
function handleStateChange(){
if(objectRequest.readyState == 4){
scan(objectRequest.responseXML);
}
}
function scan( nodo){
complInd++;
var attrs = "";
if( nodo.nodeType == 1 ){ // Element
for( var atr = 0; atr < nodo.attributes.length; atr++ ) ...
}
if( nodo.hasChildNodes() ){
for( var i = 0; i < nodo.childNodes.length; i++ ){
scan( nodo.childNodes[i] );
}
}
}
Qualcuno saprebbe dirmi se mi sono perso qualcosa nel codice per farlo funzionare anche su explorer, chrome, safari, e opera???