Ajax Iframes - >检查是否忙?

This is a question regarding Ajax Iframes.

I have a function to open an Iframe, and set its source, however at some points I would need to open multiple Iframes, and set their sources accordingly. The second iframe should only open if the first one has not finished loading.

Psudocode:

// at some point

x = iframe;
x.src = 'dothiscode.php'

// at some later point

if (x.src = not finished loading)
  y = new iframe;
  y.src = 'domorecode.php'
else
  x.src = 'domorecode.php'

Thank you for your help!

This is possible. Set an onload event to trigger a Boolean 'iframe done' then loop through those booleans and check which iframes are finished, or open.

Are you sure there is no other way to do what you have intended except iframes?