|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Jan 2008
Città: roma
Messaggi: 296
|
[JAVASCRIPT/XML] problema con ff
salve , ho fatto una funzione js che restituisce un "oggetto" xml e che dovrebbe andare bene sia con ie che con ff , con ie va bene , e andrebbe bene anche con ff , se usasi il metodo onload , solo che vorrei che questa funzione fosse generica ( quindi nn voglio chiamare altri metodi , ma voglio l'oggetto xml , penso che se riuscissi a sincronnizare il metodo .... in modo che fa "return" solo dopo aver letto il documento
Codice:
function Xml(file){
var xmlDoc;
this.getDocument = function(){
if(window.ActiveXObject){
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.onreadystatechange=this.verificaStato;
xmlDoc.load(file);
return xmlDoc.documentElement;
}else{
xmlDoc = document.implementation.createDocument("", "", null);
//xmlDoc.onload = .....
xmlDoc.load(file);
return xmlDoc;
}
}
this.verificaStato = function (){
if (xmlDoc.readyState != 4){
return false;
}
}
}
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 11:42.



















