Intranet Links

  • Follow


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.links.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
 
0
Reply HGJS 2/16/2004 4:07:24 PM

"HGJS" <HGJS.11q9gn@mail.forum4designers.com> wrote in message
news:HGJS.11q9gn@mail.forum4designers.com...
<snip>
> Posted via http://www.forum4designers.com

form4designers.com is a bad place to read comp.lang.javascript from
because their presentation of the group garbles the Usenet posts it is
derived from and they only report a fraction of the posts made to the
group, giving an incomplete representation.

forumj4designers.com is also a bad pace to ask javascript questions from
because their misrepresentation of the group, combined with deliberate
deceptions about the nature of the service that they provide, have
resulted in a level of resentment of forum4designers.com that will
negatively impact on anyone who decides to associate themselves with
that web site.

Many other sites provide superior web-based access to Usenet, and often
without distortion or omission, including groups.google.com (who also
provide extensive and flexible archive searching facilities). But the
best method of reading and posting to comp.lang.javascript is through a
news server via newsreader software.

Richard.


0
Reply Richard 2/16/2004 4:12:36 PM


1 Replies
630 Views

(page loaded in 0.022 seconds)

Similiar Articles:













7/25/2012 10:48:35 PM


Reply: