Intranet Links

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HGJS

    Intranet Links


    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

  • Richard Cornford

    #2
    Re: Intranet Links

    "HGJS" <HGJS.11q9gn@ma il.forum4design ers.com> wrote in message
    news:HGJS.11q9g n@mail.forum4de signers.com...
    <snip>[color=blue]
    > Posted via http://www.forum4designers.com[/color]

    form4designers. com is a bad place to read comp.lang.javas cript 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.

    forumj4designer s.com is also a bad pace to ask javascript questions from
    because their misrepresentati on 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.c om (who also
    provide extensive and flexible archive searching facilities). But the
    best method of reading and posting to comp.lang.javas cript is through a
    news server via newsreader software.

    Richard.


    Comment

    Working...