I am trying to code a link that has a viariable as the 'target'. Either _top or _blank based on what page they came to the page from.
Here is my code:
I thought I had it working with the link:PHP Code:<!--
var ref;
var target;
ref = window.location.href;
function targetnew() {
if (ref.indexOf("/ssi/frames") == -1)
{
document.write("target = \"_top\"");
}
else (ref.indexOf("/ssi/frames") == 1)
{
document.write("target = \"_blank\"");
}}
//-->
<a href="times.asp" javascript=targetnew()>Times</a>
But it doesn't work (I'm a newbie =). Is there a simple way to get the function to determine the target?
Thank you =)





Bookmarks