Make focus to a window that is not a popup

S

Steel

Hi at all

I have a page with many links like:

<a href="www.1.com" target=_new>

<a href="www.2.com" target=_new>

<a href="www.3.com" target=_new>

First time that user click first link browsers open a new window with focus.

After, if user return to window containing links and click into 2th.link, my
old windows opened clicking first link now contain page of 2th link but have
not focus.

Hpw can I do to make focus to second window that is not a popip?
 
N

nick

First time that user click first link browsers open a new window with focus.

After, if user return to window containing links and click into 2th.link,my
old windows opened clicking first link now contain page of 2th link but have
not focus.

Hpw can I do to make focus to second window that is not a popip?

Something like this might work in some browsers:

var nonPopup = window.open('/link2');
nonPopup.focus();

....but it's not guaranteed. If you want to be sure that the window is
focused, your best bet is probably to close the window and open it
again...

nonPopup.close();
nonPopup = window.open('/link3');
 
T

Tim Down

Hi at all

I have a page with many links like:

<a href="www.1.com" target=_new>

<a href="www.2.com" target=_new>

<a href="www.3.com" target=_new>

First time that user click first link browsers open a new window with focus.

After, if user return to window containing links and click into 2th.link,my
old windows opened clicking first link now contain page of 2th link but have
not focus.

Hpw can I do to make focus to second window that is not a popip?

Firstly, contrary to common belief, using "_new" as the target has no
special meaning. You would get the same behaviour if you used
target="banana". What you may be thinking of is target="_blank", which
will always open a new window/tab for each link.

Secondly, opening new windows for links has disavantages, such as
annoying the user with multiple windows he/she may not want or even
notice. Unless you have an overwhelming reason open new windows, you
would probably be better off changing your design.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top