So, You Want A New Browser Window, Huh?

By Joe Burns

http://www.htmlgoodies.com/tutorials/getting_started/article.php/3479481/So-You-Want-A-New-Browser-Window-Huh.htm (Back to article)

Use these to jump around or read it all...

[Why Would I Do This?]
[Here's What Does It]
[How Do I Stop It From Happening?]

     Did you see that? A new browser window opened up! You now have two windows open at the same time. Really! Look up at the "BACK" button at the top of the page. It isn't available to you. (Except on some higher-level browsers.) That's because you've started a whole new browser session.

Why Would I Do This?

     I receive at least one letter a day asking for info on how this is done, so I put a quick tutorial together. The benefits are best used when you are demonstrating something and need two windows. You can also open other sites while keeping the user in your site. These are other uses of course, but those are the two I am most font of. Now, here's what you get:

Here's What Does It

<A HREF="http://www.site.com/page.html"
TARGET="resource window">
Text Text Text</A>

 

     See that TARGET="resource window" above? That's what does it.


How Do I Stop It From Happening?

     I also get letters stating that a client-side image map or a frames page is causing a new window. Some people want to get rid of it. Try this:

<A HREF="http://www.site.com/page.html" TARGET="_top">
Text Text Text</A>

     Notice I targeted the link to the top of the page. This is the default in HTML. Not putting it in has always resulted in an A HREF link jumping to the top of the same browser window. In order to stop the new window from popping up, you now need to force the browser's hand. Please notice the underline mark before the word "top."


     Now, go and use the commands for good, not evil. They are yours to exploit at your own will. To get back to the HTML Goodies Page, you can either Click Here, enter "/index.html" above, or close this window. If you get a dialogue box that asks Close all windows and exit? click No, go back and choose "close," not exit.

     My suggestion would be to close this window altogether. You're taking up precious memory running two windows.

 

[Why Would I Do This?]
[Here's What Does It]
[How Do I Stop It From Happening?]