Hi,
I want to place a piece of JavaScript at the top of my page/s that wil
tell all links on that page to open in certain target windows dependin
on the hostname.
Suppose the intranet address is http://intranet
so this means that the hostname is "intranet" right?
If I want all intranet page links to open in the same window but al
other links (ie external internet links) to open in a new windo
(_blank) then would I use something like below? Please correct an
place I've gone wrong:
if(document.lin ks.hostname == "intranet") {
this.target = "_top";
} return true;
But somewhere in there I would also need an "else" statement to tell i
to open all other links in "_blank" target. Can someone please tell m
where that should be added in. I'm fairly new to javascript and am no
exactly sure what order some of this stuff should go in.
Thank
HGJ
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message46077.htm
Comment