I have a button that loads two different pages in two iframes. I need to wait for those loads to complete (like ready(), don't care about images and other content) and then trigger another action. How can I do this?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
One way would be for the iFrame content to signal that it is ready. Here is a simplistic way to do this:
Main Page
In each iFrame
Using $.when() will help you (jQuery 1.5 and higher). For example:
In my opinion, the safest solution might be to have a parent iframe that would embedd both iframes and wait for the entire page (the parent page) to load :
The drawback is that it's a lot of iframes