Jump to content

- - - - -

Open links in a new window and avoid browser crashes


  • This topic is locked This topic is locked
No replies to this topic

#1 Phzzz


    Phzzz izzz a Nugatory and Totally Insignificant Peon!

  • Administrators
  • 1,013 posts
  • LocationNew York

Posted 23 April 2013 - 09:37 PM

To have links open in a new window and avoid browser crashes

You "can" use this code...
<A HREF="http://www.whatever.com" target="_blank">Whatever</A>
However, I'll add to this just a bit...

The above code will open a new window every time it is used. But, say there are 10 links on a page... all using target="_blank", and you click on all 10 links. What happens is 10 entirely new windows are open at the same time. Too many instances of browser windows opening may cause the browser software to crash.

To prevent this, and also, a much better way of opening new browser windows is to use a "dedicated" target. That will allow each and every link to open in the SAME new window, no matter what.

3 Examples:
<A HREF="http://www.whatever.com" target="_new">Whatever</A>

<A HREF="http://www.whatever.com" target="_anything">Whatever</A>

<A HREF="http://www.whatever.com" target="_whatever">Whatever</A>
Any of the 3 above target examples or similar targets (dedicated - you pick the name) will work just fine. Now, say there are 10 links on a page... all using the SAME dedicated target, and you click on all 10 links. What happens is ONLY ONE entirely new window opens up, and each time you click on another of the 10 links on that page, that URL will open in the SAME dedicated target window. The browser can't crash because instead of 11 windows (1 original site location "starting" window, including the 10 "blank" targeted windows) opening, as in the first target="_blank" example, only 2 windows will open (1 original site location "starting" window, and all other links opening in the 1 "dedicated" targeted window).

Kinda like a standalone frame, in a way, with all outside links pointing to the same target window.

Take care!
Tom (aka Phzzz; aka Scruffy; aka Nunzio)

Please don't Email or Message me for help/support. Instead, either start a NEW TOPIC or post a REPLY in the appropriate thread in these forums. This will also benefit others who may have a similar question or problem. And please read the rules for Private Messaging. - Phzzz (aka Scruffy; aka Nunzio; aka Tom)