faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 1 people (0%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

How can I determine when a form POST to a remote page in an IFRAME has finished loading?

Apr 8th, 2008 18:41
ha mo, Dave Clark, Mike Darling,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mike,
     Use the IFRAME onload event.  You won't be able to query the 
content of the IFRAME if the remote document is not in the same domain 
as the parent document, but at least you will know the IFRAME has 
completed the load process.  And, by the way, you may want to add the 
onload handler to the IFRAME at some point *after* the IFRAME has 
loaded the initial time.  Or, you can have two onload handlers -- one 
for the initial load and one for after the IFRAME form has been 
submitted.  For example, these are the handlers:
function InitialLoad(obj)
{
    obj.onload = new Function("return SubsequentLoad(this)");
    return true;
}
function SubsequentLoad(obj)
{
    return true;
}
     The IFRAME could then be coded as follows:
<iframe onload="return InitialLoad(this)">
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com