[thelist] _blank smackdown 2002, suggestions, then?
Julia Frizzell
Julia_Frizzell at brown.edu
Tue Apr 23 14:17:01 CDT 2002
At 14:05 -0500 4/23/02, Miriam Frost wrote:
>Awwright, whatever, enough, UNCLE!
>I'm giving you the option to turn off new windows when you're on my site.
>
>(Since it's _my_ site, guess which will be the default? But the Option Will
>Be Yours.)
>
>I want my code to be sexy and all XML strict.
>I don't want any extra coding within the href.
>I've been all over Google looking for just that little on/off trick, to no
>(or little) avail. Help me to help you enjoy my site! What a) works and b)
>validates??
I've seen this on many blogs. Don't know if it'll work for what you
want or not...
<script language="JavaScript">
<!--
// thanks to randomwalks.com for this code
function targetLinks(boNew)
{
if (boNew) where = "_blank";
else where = "_self";
for (var i=0; i<=(document.links.length-1); i++)
{
document.links[i].target = where;
}
}
//--></script>
<form><input type="checkbox" name="targetnew"
onclick="targetLinks(this.checked)">new windows?</form>
More information about the thelist
mailing list