Bookmark and Share

JavaScript Snippets – Link Magic

Some of the Neat Little Tricks You Can Do With JavaScript Links

Open a new window with a link

Between Head Tags:

function load() {
var load ='','','scrollbars=no,

Your Link:

<a href="javascript:load()">Open Window</a>

As you can see in the code example above, you can control a some attributes of the new window. You would replace with your own link. Then you can decide the hieght and width of the new window and whether or not the user can resize it (yes/no), if it shows the scrollbars or if the browser toolbar and menu bar should show.

Close a Window With A Link

<a href="javascript: self.close()">Close Window</a>

Reload a Window With A Link

<a href="javascript: window.location.reload()">Reload Window</a>

Go Back 1 Page With A Link

<a href="javascript: history.go(-1)">Back</a>

Print Page

<a href="#" onClick="window.print()">Print Page</a>

Add To Favorites (Internet Explorer Only)

<a href="javascript:window.external.AddFavorite('', 
'Your Site Name')">Add to Favorites</a>


Useful JavaScript Tools
Better than Pop-ups, Pop-ins, and Pop-Unders
Optimize your advertising real estate and increase
ad conversions with Corner Stay Ads & Peel Away Ads

Comments are closed.


Hosting Info

Hosting Help

Online Business

Join Our Newsletter

Copyright © 2002-, Hylidix LLC - #74, Reading, MA 01867-0174. All rights reserved. Disclaimer | Disclosure