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?

27 of 46 people (59%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How to synchronize? I want the code to wait executing until Iframe.location is fully loaded?

Apr 6th, 2008 20:02
ha mo, Steven Armstrong, Mark Ever,


There's an easy way to do this in JavaScript.

iframe code:

loaded = false;
onload = function() { loaded = true };


main page code:

function fnDoSomething()
{
  if (!document.frames['iframename'].loaded)
  {
    setTimeout('fnDoSomething()',100);
    return;
  }
  
  // here you put the rest of your code
}



HTH,
regards
Steven


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