So I create an iframe and it's supposed to continue reloading after a function runs. The function reads info that is in the iframe. Currently I have something like this (Which works);
function loaded(){
alert(iframe.contentDocument.getElementsByClassName("blah")[0].innerHTML);
iframe.src = filePath; //reloads the iframe
}
iframe.onload = loaded;
Because i'de like it to execute faster, would something like this work; Where the function runs as soon as the iframe has loaded the DOM;
function loaded(){
alert(iframe.contentDocument.getElementsByClassName("blah")[0].innerHTML);
iframe.src = filePath; //reloads the iframe
}
iframe.addEventListener("DOMContentLoaded", loaded, false);