Link to home
Start Free TrialLog in
Avatar of derekstattin
derekstattin

asked on

Using a toggle/open sindow button

I have some code to open a new window that is in page A.

<a href="" class="login" onclick="javascript: secondwindow =open('http://www.site.com/login.php','login','height=900, width=900, scrollbars=yes,resizable=yes,top=100,left=100,screenx=100,screeny=100,addressbar=1,toolbar=1,statusbar=1,menubar=1')">-login-</a>

1.When the user opens the new window, Page B, using the link above,
2. Then goes back to page A,
3. Then clicks the link in page A(ie the link above again), I would like the link to "toggle", rather than try to open a window that is already open.

Just using the code above, the second window stays behind the first.

Do I just need to use a toggle, or a combination of open window and toggle, where javascript recognizes if the window B is already open? Can you help me modify the code above?

 
ASKER CERTIFIED SOLUTION
Avatar of BogoJoker
BogoJoker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial