Salvin Francis
Salvin Francis

Reputation: 4267

Popup and change location at the same time

Basically here is my code (Authenticator.jsp):

window.location.replace("Login.html"); // replace method also takes care of history
window.open ("Main.html", "Welcome logged in user");

Expected behaviour:

  1. We basically open the Main.html in a popup once a user has logged in.
  2. The current window must point to Login.html and main should open in a popup.

Actual behaviour:

  1. Main.html is opened in a popup
  2. Authenticator.jsp switches back to Login.html, BUT this Window gets focus !! and is shown in Front of my popup !!

Is there a solution for this ? This behaviour occurs in IE6 (I havent checked IE7 and IE8), it does not occur in Firefox and chrome

Upvotes: 1

Views: 540

Answers (1)

Neal Donnan
Neal Donnan

Reputation: 1733

I think you should call

window.location = "Login.html"

And then move the call to

window.open ("Main.html", "Welcome logged in user");

into the onload event of the Login.html page.

Upvotes: 1

Related Questions