Prev: How to trigger two events with 2 document.locations?
Next: FAQ Topic - What is Ajax? (2010-07-01)
From: Steel on 30 Jun 2010 16:38 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?
From: nick on 30 Jun 2010 17:49 On Jun 30, 4:38 pm, "Steel" <st...(a)nonspam.com> wrote: > 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');
From: Tim Down on 1 Jul 2010 10:59 On Jun 30, 9:38 pm, "Steel" <st...(a)nonspam.com> wrote: > 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
|
Pages: 1 Prev: How to trigger two events with 2 document.locations? Next: FAQ Topic - What is Ajax? (2010-07-01) |