PDA

View Full Version : Loading precedence



angrybob
22 Aug 2007, 12:37 AM
So, I have a page that submits a form in a hidden div table after a user authenticates. This form posts to another website and logs the user in there, authenticating and giving them their session cookie. HOWEVER...

After they authenticate, that page automatically redirects them to their profile page.

This isn't a HUGE problem, since it's in a hidden div in an iframe...but it does take forever to load. ALSO, here's the main clincher. After they get this cookie from that form being submitted, they need to then be directed to a different page. But that redirect can only happen AFTER they get the cookie.

How would I do this?

I tried putting a javascript window.location='XXX' to redirect them after the form posts, since that is lower in the page....but it redirects them before the form is submitted.

How can I control this javascript redirect to only execute after that other page loads?