J
jackwootton
Hello,
I have a for loop, which calls a method
for (var i = 0; i < GmailXChat.gmailChatFrames.length; i ++)
{
// myObjectArray.constructIframe();
}
the method 'constructIframe();' invloves constructing an HTML iframe,
adding various elements to it and displaying it on a page. When
constructing an iframe and adding it to a page dynamically, it is
necessary to use setTimeout('finishIframe()',0) to complete the
iframe. Where 'finishIframe()' adds any content to the iframe
itself. This must be done since it stops the browser from attempting
to add content to the iframe before any of the elements to be added
have been created.
This all works fine if the loop on cycles only once. However if the
loop cycles more than once the following problem occurs:
Where the call 'setTimeout('finishIframe()',0)' occurs, control is
returned (to the loop), so the loop cycles round and calls
myObjectArray.constructIframe() again, before the original call to
myObjectArray.constructIframe() is actually completed.
I need a call to myObjectArray.constructIframe() to complete fully
(including the call to setTimeout('finishIframe()',0)), before control
is returned to the loop, and the loop cycles.
Hope someone can help, have been stuck on this for quite a while.
Many thanks,
Jack
I have a for loop, which calls a method
for (var i = 0; i < GmailXChat.gmailChatFrames.length; i ++)
{
// myObjectArray.constructIframe();
}
the method 'constructIframe();' invloves constructing an HTML iframe,
adding various elements to it and displaying it on a page. When
constructing an iframe and adding it to a page dynamically, it is
necessary to use setTimeout('finishIframe()',0) to complete the
iframe. Where 'finishIframe()' adds any content to the iframe
itself. This must be done since it stops the browser from attempting
to add content to the iframe before any of the elements to be added
have been created.
This all works fine if the loop on cycles only once. However if the
loop cycles more than once the following problem occurs:
Where the call 'setTimeout('finishIframe()',0)' occurs, control is
returned (to the loop), so the loop cycles round and calls
myObjectArray.constructIframe() again, before the original call to
myObjectArray.constructIframe() is actually completed.
I need a call to myObjectArray.constructIframe() to complete fully
(including the call to setTimeout('finishIframe()',0)), before control
is returned to the loop, and the loop cycles.
Hope someone can help, have been stuck on this for quite a while.
Many thanks,
Jack