Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript on a redirect page

Status
Not open for further replies.

awingnut

Programmer
Joined
Feb 24, 2003
Messages
759
Location
US
Before I go to the trouble of programming it, I have a question about javascript on a redirect page. If the javascript is the first object on a page that does a redirect, will the redirection wait until the javascript completes? Specifically, if the script contains and alert, will the redirect happen immediately or after the response from the user.

As an aside if a confirm is used instead of an alert can the redirect be programmatically effected by the response? TIA.
 
if the script contains and alert, will the redirect happen immediately

If the redirect is before the alert in source order, the redirect will happen first. If not, the alert will.

The same holds true of the confirm, so if the latter, yes, you can control the redirection with the user's choice.

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top