Open external links optionally in new window

[Total: 0    Average: 0/5]

User can choose to open links outside the site in a new window or in the current window.

Head Code:

<script language="javascript">
var THIS_SITE="";
function wo(_checked)
  where = _checked?"_blank":"_self";
  for (var i=0; i<=(document.links.length-1); i++)
	 * If THIS_SITE is not in the URL then set the link to
	 * open or not open up a new page as defined by the form checkbox.
// -->

Body Code:

<form name="f">
<input type=checkbox name="c" onclick="wo(this.checked)">Links to other sites open in a new window.
<li>Visit <a href="">St. Paul's Cathedral</a>, London</li>
<li>See <a href="">another link</a> on this site</li>
<li><a href=""</a>This site's home page</li>

Times Viewed: 5

Leave a Reply

Your email address will not be published. Required fields are marked *