Stavo nascondendo l'icona di caricamento quando il mio file ha terminato il download in un iframe
. Funzionava bene in Internet Explorer. In Chrome non sono riuscito a farlo attendere fino al caricamento del file nello iframe
.Impossibile sostituire onreadystate per caricare
Qualsiasi aiuto è apprezzato.
function checkIframeLoaded() {
var iFrameObject = document.getElementById("iframehidden");
var iframeDoc = iFrameObject.contentDocument || iFrameObject.contentWindow.document;
if (iframeDoc.readyState == 'complete' || iframeDoc.readyState == "interactive" || iframeDoc.readyState == "loaded") {
if (top.document.getElementById("tblPleaseWait") != null) {
top.document.getElementById("tblPleaseWait").style.display = "none";
}
else if (document.getElementById("tblPleaseWait") != null) {
document.getElementById("tblPleaseWait").style.display = "none";
}
return;
}
}
function setupLoader(objIFrame, brestorepane) {
if (objIFrame.attachEvent) {
if (brestorepane) {
objIFrame.attachEvent('onreadystatechange', checkIframeLoaded);
}
} else {
if (brestorepane) {
objIFrame.addEventListener('load', checkIframeLoaded());
}
}
}
yea sua un errore di battitura, ma il carico non è aiutando aspettare fino objIFrame viene caricato –
Così, dopo aver fissato entrambe le questioni, il problema persiste? Dovresti modificare la domanda con il codice aggiornato, o otterrai più risposte solo per dirti di risolvere questi due problemi. –
Notando che è stato corretto solo il typo 'addEventListener'; stai ancora chiamando 'checkIframeLoaded()' quando non vuoi. Sono ancora curioso di sapere cosa succede quando rimuovi le parentesi, come nella mia risposta. –