I have two frames. The pages in both frames come from the same domain (either localhost or a live domain - both using the same protocol).
The first frame needs to ac
I solved it by:
1. Giving the target frame both a name and an id
2. testing for both
3. testing that a variable (finishedLoading) within the target frame was set to true
(code altered to use === instead of == when testing finishedLoading)
function isSurveyLoaded(){
if(!(parent.frames["xsample"] || parent.document.getElementById('xsample'))){
return false;
}
else{
if(parent.frames["xsample"]){
target=parent.frames["xsample"];
}
else{
target=parent.document.getElementById('xsample');
}
}
if ((target.finishedLoading==='undefined') || (target.finishedLoading===false) ){
return false;
}
else{
return true;
}
}
Now simplified by using