Thursday, March 28, 2024

So, You Want A New Browser Window, Huh?


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:


  • The new browser window is fully operational, but is not attached to the window that it came from. There are no “back” capabilities. (Except on some higher-level Explorer browsers.)
  • The way to get back to the page below is to close the top-level window. In windows 3.x, choose “CLOSE” under the FILE menu in the top left hand of the browser. In MAC and W95, hit the button in the upper right-hand corner.
  • If you choose “Exit,” you’ll close the browser altogether. You don’t want to do that.





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?]

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured