Hide URL in statusbar when mouse over link

Discussion in 'Javascript' started by Targa, Dec 30, 2004.

  1. Targa

    Targa Guest

    I know you can do an onmouseover/onmouseout to display alternate text for
    links but Im looking for a script that would cover all links on a page
    without having to add code to each link.

    Is there such a thing?

    I also know lots of people hate it when you do that but this is for an
    application which requires IE5.5+ and there is no need for the user to view
    the links.

    TIA!
    Targa, Dec 30, 2004
    #1
    1. Advertising

  2. Targa

    McKirahan Guest

    "Targa" <> wrote in message
    news:J4PAd.781$...
    > I know you can do an onmouseover/onmouseout to display alternate text for
    > links but Im looking for a script that would cover all links on a page
    > without having to add code to each link.
    >
    > Is there such a thing?
    >
    > I also know lots of people hate it when you do that but this is for an
    > application which requires IE5.5+ and there is no need for the user to

    view
    > the links.
    >
    > TIA!


    Is this what you want?

    <style type="text/css">
    a { text-decoration:none }
    </style>
    McKirahan, Dec 30, 2004
    #2
    1. Advertising

  3. Targa

    Targa Guest

    Thanks but no - that would just keep links from being underlined.

    I need to keep the URL of all links from showing up in the statusbar.


    "McKirahan" <> wrote in message
    news:SdUAd.305580$HA.161123@attbi_s01...
    > "Targa" <> wrote in message
    > news:J4PAd.781$...
    >> I know you can do an onmouseover/onmouseout to display alternate text for
    >> links but Im looking for a script that would cover all links on a page
    >> without having to add code to each link.
    >>
    >> Is there such a thing?
    >>
    >> I also know lots of people hate it when you do that but this is for an
    >> application which requires IE5.5+ and there is no need for the user to

    > view
    >> the links.
    >>
    >> TIA!

    >
    > Is this what you want?
    >
    > <style type="text/css">
    > a { text-decoration:none }
    > </style>
    >
    >
    Targa, Dec 30, 2004
    #3
  4. Targa

    McKirahan Guest

    "Targa" <> wrote in message
    news:VfVAd.812$...
    > Thanks but no - that would just keep links from being underlined.
    >
    > I need to keep the URL of all links from showing up in the statusbar.
    >
    >
    > "McKirahan" <> wrote in message
    > news:SdUAd.305580$HA.161123@attbi_s01...
    > > "Targa" <> wrote in message
    > > news:J4PAd.781$...
    > >> I know you can do an onmouseover/onmouseout to display alternate text

    for
    > >> links but Im looking for a script that would cover all links on a page
    > >> without having to add code to each link.
    > >>
    > >> Is there such a thing?
    > >>
    > >> I also know lots of people hate it when you do that but this is for an
    > >> application which requires IE5.5+ and there is no need for the user to

    > > view
    > >> the links.
    > >>
    > >> TIA!

    > >
    > > Is this what you want?
    > >
    > > <style type="text/css">
    > > a { text-decoration:none }
    > > </style>



    Your original post didn't mention the statusbar.

    Will one of these work for you?

    <html>
    <head>
    <title>hrefhide.htm</title>
    <script type="text/javascript">
    function a() {
    location.href = "http://www.google.com/";
    }
    </script>
    </head>
    <body>
    <a href="javascript:a()">Google</a>
    <br><br>
    <a href="#" onclick="location.href='http://www.google.com/'">Google</a>
    <br><br>
    <a onclick="location.href='http://www.google.com/'"
    style="cursor:hand"><u>Google</u></a>
    <br><br>
    <a onclick="location.href='http://www.google.com/'"
    style="cursor:pointer"><u>Google</u></a>
    </body>
    </html>
    McKirahan, Dec 30, 2004
    #4
  5. Targa wrote:

    > Im looking for a script that would cover all links on a page
    > without having to add code to each link.


    > I also know lots of people hate it when you do that but this is for an
    > application which requires IE5.5+ and there is no need for the user to view
    > the links.


    Tested with IE 6:

    <html lang="en">
    <head>
    <title>mouseover handler</title>
    <script type="text/javascript">
    function mouseOutHandler (evt) {
    if (typeof evt != 'undefined') {
    evt = window.event;
    }
    window.status = '';
    if (evt && typeof evt.returnValue != 'undefined') {
    evt.returnValue = true;
    }
    if (evt && evt.preventDefault) {
    evt.preventDefault();
    }
    return true;
    }

    window.onload = function (evt) {
    if (document.addEventListener) {
    document.addEventListener(
    'mouseover',
    mouseOutHandler,
    false
    );
    }
    else if (document.attachEvent) {
    document.attachEvent(
    'onmouseover',
    mouseOutHandler
    );
    }
    };
    </script>
    </head>
    <body>
    <p>
    Does the status bar show the link URL?
    <a href="http://www.example.com/">example</a>
    </p>
    </body>
    </html>

    Should work with IE 5.5 too.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Dec 30, 2004
    #5
  6. Targa

    Targa Guest

    Thanks again for the reply.

    Hide URL in Statusbar... is the subject of this thread.

    The code provided requires modification to each link which wont work for me.
    I need a single script that would hide all urls on the page.





    "McKirahan" <> wrote in message
    news:swWAd.828033$8_6.752314@attbi_s04...
    > "Targa" <> wrote in message
    > news:VfVAd.812$...
    >> Thanks but no - that would just keep links from being underlined.
    >>
    >> I need to keep the URL of all links from showing up in the statusbar.
    >>
    >>
    >> "McKirahan" <> wrote in message
    >> news:SdUAd.305580$HA.161123@attbi_s01...
    >> > "Targa" <> wrote in message
    >> > news:J4PAd.781$...
    >> >> I know you can do an onmouseover/onmouseout to display alternate text

    > for
    >> >> links but Im looking for a script that would cover all links on a page
    >> >> without having to add code to each link.
    >> >>
    >> >> Is there such a thing?
    >> >>
    >> >> I also know lots of people hate it when you do that but this is for an
    >> >> application which requires IE5.5+ and there is no need for the user to
    >> > view
    >> >> the links.
    >> >>
    >> >> TIA!
    >> >
    >> > Is this what you want?
    >> >
    >> > <style type="text/css">
    >> > a { text-decoration:none }
    >> > </style>

    >
    >
    > Your original post didn't mention the statusbar.
    >
    > Will one of these work for you?
    >
    > <html>
    > <head>
    > <title>hrefhide.htm</title>
    > <script type="text/javascript">
    > function a() {
    > location.href = "http://www.google.com/";
    > }
    > </script>
    > </head>
    > <body>
    > <a href="javascript:a()">Google</a>
    > <br><br>
    > <a href="#" onclick="location.href='http://www.google.com/'">Google</a>
    > <br><br>
    > <a onclick="location.href='http://www.google.com/'"
    > style="cursor:hand"><u>Google</u></a>
    > <br><br>
    > <a onclick="location.href='http://www.google.com/'"
    > style="cursor:pointer"><u>Google</u></a>
    > </body>
    > </html>
    >
    >
    Targa, Dec 30, 2004
    #6
  7. Targa

    Targa Guest

    Thanks Martin - Works great!


    "Martin Honnen" <> wrote in message
    news:41d43ab5$0$23130$-online.net...
    >
    >
    > Targa wrote:
    >
    >> Im looking for a script that would cover all links on a page without
    >> having to add code to each link.

    >
    >> I also know lots of people hate it when you do that but this is for an
    >> application which requires IE5.5+ and there is no need for the user to
    >> view the links.

    >
    > Tested with IE 6:
    >
    > <html lang="en">
    > <head>
    > <title>mouseover handler</title>
    > <script type="text/javascript">
    > function mouseOutHandler (evt) {
    > if (typeof evt != 'undefined') {
    > evt = window.event;
    > }
    > window.status = '';
    > if (evt && typeof evt.returnValue != 'undefined') {
    > evt.returnValue = true;
    > }
    > if (evt && evt.preventDefault) {
    > evt.preventDefault();
    > }
    > return true;
    > }
    >
    > window.onload = function (evt) {
    > if (document.addEventListener) {
    > document.addEventListener(
    > 'mouseover',
    > mouseOutHandler,
    > false
    > );
    > }
    > else if (document.attachEvent) {
    > document.attachEvent(
    > 'onmouseover',
    > mouseOutHandler
    > );
    > }
    > };
    > </script>
    > </head>
    > <body>
    > <p>
    > Does the status bar show the link URL?
    > <a href="http://www.example.com/">example</a>
    > </p>
    > </body>
    > </html>
    >
    > Should work with IE 5.5 too.
    >
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
    Targa, Dec 30, 2004
    #7
  8. Targa

    McKirahan Guest

    "Targa" <> wrote in message
    news:YEZAd.836$...
    > Thanks again for the reply.
    >
    > Hide URL in Statusbar... is the subject of this thread.


    http://jibbering.com/faq/#FAQ2_3

    "Use the Subject: of your post to indicate the type of problem you have, but
    include the question in the body aswell."


    P.S. I'm glad that you found a solution.
    McKirahan, Dec 30, 2004
    #8
  9. Targa

    Grant Wagner Guest

    "Martin Honnen" <> wrote in message
    news:41d43ab5$0$23130$-online.net...
    >
    >
    > Targa wrote:
    >
    > > Im looking for a script that would cover all links on a page
    > > without having to add code to each link.

    >
    > > I also know lots of people hate it when you do that but this is for

    an
    > > application which requires IE5.5+ and there is no need for the user

    to view
    > > the links.

    >
    > Tested with IE 6:
    >
    > Should work with IE 5.5 too.


    Below works in Netscape 4, IE 4+, Opera 6+ and Mozilla:

    function setAllHrefMOut(f, d, inLayer) {
    if (!inLayer) {
    d = document;
    }

    if (d) {

    var i;

    if (d.links) {
    i = d.links.length;
    while (i-- > 0) {
    if (!d.links.onmouseout) {
    d.links.onmouseout = f;
    }
    }
    }

    if (d.layers) {
    i = d.layers.length;
    while (i-- > 0) {
    setAllHrefMOut(f, d.layers.document, true);
    }
    }
    }
    } // setAllHrefMOut()

    Corresponding setAllHrefMOver() could be written as well, or modify the
    current function to specify mouseover/mouseout.

    Called using:

    function myMouseOut() {
    // do whatever
    return true;
    }
    setAllHrefMOut(myMouseOut);

    Yes, yes, I realized later that I didn't really need to pass "inLayer",
    but I was concerned someone would see the method signature and do:

    setAllHrefMOut(myMouseOut, document);

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Jan 6, 2005
    #9
  10. Targa

    Randell D. Guest

    Hi,

    I think this is what you are looking for:

    Place the following inside the <HEAD> tags...

    <script language="JavaScript" type="text/javascript">
    function updateStatusBar()
    {
    window.status = " ";
    timerID= setTimeout("updateStatusBar()", 250);

    }
    </script>

    And call the function either with an onload in the BODY tag, or call it
    using a seperate javascript call at the very end of your html... thus

    ..
    ..
    ..
    ..
    <script language="JavaScript" type="text/javascript">
    updateStatusBar();
    </script>
    </BODY>
    </HTML>

    The above loops every 250ms calling the function updateStatusBar which
    sets the status bar to a space... Perhaps 250ms is too small - looping
    that fast might consume too much CPU on slower machines - don't know -
    you'll have to test it.

    I hope it helps
    randell d.


    Targa wrote:
    > I know you can do an onmouseover/onmouseout to display alternate text for
    > links but Im looking for a script that would cover all links on a page
    > without having to add code to each link.
    >
    > Is there such a thing?
    >
    > I also know lots of people hate it when you do that but this is for an
    > application which requires IE5.5+ and there is no need for the user to view
    > the links.
    >
    > TIA!
    >
    >
    >
    >
    Randell D., Jan 27, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Munro

    MDI StatusBar

    Kevin Munro, Nov 3, 2003, in forum: Java
    Replies:
    0
    Views:
    485
    Kevin Munro
    Nov 3, 2003
  2. Adam Prenosil

    Javascript link and statusbar

    Adam Prenosil, Jul 30, 2003, in forum: HTML
    Replies:
    8
    Views:
    406
  3. Justin
    Replies:
    1
    Views:
    99
    Lasse Reichstein Nielsen
    Sep 28, 2003
  4. news.frontiernet.net

    Simple Mouse-Over Show/Hide with Delay Javascript Need

    news.frontiernet.net, Jun 2, 2004, in forum: Javascript
    Replies:
    0
    Views:
    141
    news.frontiernet.net
    Jun 2, 2004
  5. Axel Dahmen

    Can Hide Browser Statusbar

    Axel Dahmen, Sep 4, 2005, in forum: Javascript
    Replies:
    8
    Views:
    148
Loading...

Share This Page