Webmaster Secrets | Webmaster Freebies
Goodbye, cruel world!
Using a link to close the current browser window

By Brett McCarron, webmaster
The Blame Productions


Photo credit: (C) 2000 The Blame Productions

This is a neat trick to close the current browser window with a link. While its uses may seem limited, there are times where a thoughtful webmaster should employ it, such as with a popup or pop-under ad, or when giving the user a goodbye message after the user logs out of a particular application.


<A HREF="javascript:window.close()">close this window</A>

Example: To see this secret in action, click here to open a popup window for the fictitious "Teeth B-White Tooth Polish," then use the "Goodbye, Cruel World!" hyperlink to close the popup and return to this page.



More Webmaster Secrets




Copyright © 1996-2017 Blamepro.com
Trademarks and copyrights used herein are the property of their respective holders.