Detecting if iframe doc has loaded

Hi Clifton,
I'm pretty sure this one is a lost cause so don't waste any time on it. I would like to know if and when a web page has been loaded after pgGotoURL. The web page is a document chosen by a teacher it can be literally anything that is loadable in an iframe. For pages that are not loadable I have a plan B as I have already mentioned if you remember.
It would be useful to detect the load because teachers may program tasks to be done in limited time. I have tried this.
although it would not be a click in the finished version but a user event sent by a timer. I get neither Yes or No but the Security error. As I said I think there is no way round this except to advise teachers not to create tasks to be done in linited time when using a web page. However I thought I would get your opinion before continuing.
John
I'm pretty sure this one is a lost cause so don't waste any time on it. I would like to know if and when a web page has been loaded after pgGotoURL. The web page is a document chosen by a teacher it can be literally anything that is loadable in an iframe. For pages that are not loadable I have a plan B as I have already mentioned if you remember.
It would be useful to detect the load because teachers may program tasks to be done in limited time. I have tried this.
- Code: Select all
<function name="myClick" event="click" params="" useTB="true">
<![CDATA[
var iframeDoc = keys.winObj.contentDocument || keys.winObj.contentWindow.document;
if (iframeDoc)
{
alert("Yes");
//alert(iframeDoc.readyState); //SecurityError: Permission denied to access property "document" on cross-origin object (line number 3)
}
else
{
alert("No");
}
]]>
</function>
</textDisplayBar>
although it would not be a click in the finished version but a user event sent by a timer. I get neither Yes or No but the Security error. As I said I think there is no way round this except to advise teachers not to create tasks to be done in linited time when using a web page. However I thought I would get your opinion before continuing.
John