Targeting Windows
The problem with the hypertext medium is that when a users click on an interesting link on your page, they might never come back. One currently popular solution to this problem is to make the target document display in a second browser window. In that way, your page is still readily available in the background.
This technique is not without controversy, however. Many users find the loss of control over their browsing experience annoying. Windows users might not even realize a new window has opened in front of their current window if they have their browsers maximized to full screen. So keep both the good and the bad in mind when deciding whether to use pop-up windows.
Use the target
attribute
of the anchor tag to launch a new browser window for the linked
document. Setting the target attribute to
"_blank"
causes the browser to
open a fresh browser window. For example:
<A HREF="http://www.oreilly.com/" TARGET="_blank">...</A>
If you set every link on your page to target a
_blank window, every link will launch a new
window, potentially leaving your user with a mess of open windows.
A better method, especially if you have more than one link, is to give the targeted window a specific name, which can then be reused by subsequent links. The following link will open a new window called “display”:
<A HREF="http://www.oreilly.com/" TARGET="display">...</A>
If you target every link on that page to the “display” window, each targeted document will open in the same second ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access