for example I use Frames.
each can run different JS code.
I need to wait until a frame is loaded and then access it from another Frame.
Main Topics
Browse All TopicsHi.
It looks that my solution works only for IE6.
it is javascript code that use invisible showModalDialog.
but it is not supported in IE7 :-(
can you suggest an alternative solution?
note: solution only for IE is acceptable.
Thanks, Aryeh.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
One way around this is to set a global variable in each frame when that frame is loaded. Your code in each frame would then keep running either setTimeout() or setInterval() loops until both frames are loaded before proceeding. Naturally, this isn't too beautiful, but you wouldn't expect anything else from trying to coordinate two frame loads.
There is a good article that explains the problem
http://www.faqts.com/knowl
But it suggests the same solution I choose that is obsolete for IE7.
As I said, run your code periodically inside setTimeout() or setInterval(). As in:
function mycode() {
if ( /* do check for other frame's loaded variable */ ) {
// Code you need blocked
} else {
setTimeout('mycode()', 200);
}
}
mycode();
This mimics blocking and has the advantage of being cross-browser.
I know my code is not blocking in the strictest sense. That's why I said, "This MIMICS blocking." I also explained why "real blocking," as you call it, is not desirable on the web. If you must, go ahead and run you while loop to block until both frames are loaded, testing against the global variables on each, but it's also possible a browser will detect and prompt to stop such a script.
Business Accounts
Answer for Membership
by: ZylochPosted on 2009-08-01 at 15:04:46ID: 24996885
What is the context of this problem? There is no real JavaScript sleep() for a good reason, because it is almost never needed and it freezes up the browser.
lock/
If you really need the user to be blocked on your page, you can contemplate trying out this plugin for jQuery: http://malsup.com/jquery/b