Intranet Links

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

    Intranet Links


    I would like to place a single piece of JavaScript at the top of m
    intranet page/s to tell every link on that page to open in a certai
    target window, depending on the "hostname".

    Suppose my intranet address was http://intranet_01

    If I wanted all of the links on a page that were linked to files withi
    the intranet to open in a new window, would I place a piece of cod
    like this at the top of the page:

    <script language = "JavaScript ">
    if (links.hostname == 'intranet_01') {
    link.target = '_blank';
    }
    return true;"
    </script>

    Please tell me if any correction needs to be made to this, such as i
    it should say this.target or links.target instead of link.target.

    Also, if I wanted all other links that are NOT in the intranet to ope
    in the same window, I would then have to place an "else" statement i
    there somewhere too such as else link.target = "_top";

    Where would this else statement go within my script? I am new to JS an
    do not completely know exactly where each piece of code should go.

    Thanks

    HGJ

  • Richard Cornford

    #2
    Re: Intranet Links

    "HGJS" <HGJS.11tkwo@ma il.forum4design ers.com> wrote in message
    news:HGJS.11tkw o@mail.forum4de signers.com...[color=blue]
    >I would like to place a single piece of JavaScript at the top
    >of my intranet page/s to tell every link on that page to open
    >in a certain target window, depending on the "hostname".[/color]
    <snip>

    Why have you re-posted this question through formu4designers .com? I have
    already told you why responding to questions originating from that site
    is not worth the time of anyone here. The fact that you cannot see that
    response does nothing more than illustrate why that is the case.

    But I will reiterate:-

    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. Removing significant formatting, omitting sections and
    adding text and white space that was not part of the original posts to
    Usenet. And they only report a fraction of the posts made to the group,
    giving an incomplete and inaccurate representation of the group.

    In addition, the posting mechanism used by forum4designers .com fails to
    properly implement RFC 1036 (Standard for Interchange of USENET
    Messages), and in a way that is likely to result in confusion as to
    conversational flow and intended respondee for anyone using genuine
    Usenet software.

    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.

    But being aware that forum4designers .com may not report posts made in
    response to questions asked from there, and will actively modify/distort
    any responses they do show, potential responders may consider it a waste
    of there time to put any effort into responding to posts originating
    from forum4designers .com even if they have no attitude towards that
    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 (standard and standards conforming) newsreader software.

    Richard.


    Comment

    Working...