1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to hide a link´s destination URL?

Discussion in 'JavaScript and AJAX' started by chris casab, May 16, 2010.

  1. chris casab

    chris casab New Member

    Joined:
    May 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi buddies. After trying hard, I really can´t figure out how this could be done:
    I have some buttons on my web page which are links to other site. When a visitor passes the mouse over them (without clicking), it becomes visible the destination URL in the status bar. I know this is the most normal thing and happens with each link in the world...But, what I want is to totally disable this function, so nothing appears in the bar when passing over buttons. In other words, I want them to have no idea at all about where they will arrive unless they click a button. Somebody can help me? :confused:

    P.S: framed redirect is not a solution in my case.

    Thanks in advance!

    Chris
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    HTML:
    <A HREF="SomeURL" onMouseMove="window.status=''">Anchor</A>
     
  3. chris casab

    chris casab New Member

    Joined:
    May 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thanks shabbir. But I´m sorry, I couldn´t make it work. Anyways, I believe the onmouseMove event is not what I´m needing. I think I need to use onmouseOver, because I want to make the status bar blank when passing only over the links. Can you imagine other solution? Mine is a plain HTML page.
    No PHP nor Scripts.
    Thanks in advance!
    Chris
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    This is Plain HTML only and It can be done by any Mouse Event onmouseMove or onmouseOver
     
  5. LynxSI

    LynxSI New Member

    Joined:
    May 23, 2010
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Developer
    Location:
    Vancouver, BC, Canada
    Home Page:
    This might not work if the user has disabled JavaScript in their client browser. You won't have much luck in that case!

    The other alternative to the above is to use a JavaScript Link Encryption script. However this will also require the client to have JavaScript enabled for their browser. This technique will encode the destination URL in a non-human readable form and then use a JavaScript function to decode it and navigate to it.

    Search in google for "JavaScript Link Encryption".
    - Ben

    P.S. Why is this valuable to you? This sounds kind of suspicious! As a web user I like to know what a page is doing for me in order to trust the web page. Otherwise I might think the sight is "spoofed" and designed for malicious intent like "phishing".
     
  6. DevPro

    DevPro New Member

    Joined:
    May 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    This won't work anymore in FireFox >= 3.5
    If you want to hide the destination Url do something like

    HTML:
    <a href="#" onclick="window.location = 'A URL'; return false;">link</a>
    Another alternative would be a url shortener like bit.ly
     
  7. johnny.dacu

    johnny.dacu New Member

    Joined:
    Jul 6, 2010
    Messages:
    88
    Likes Received:
    4
    Trophy Points:
    0
    maybe a server side encryption is a better solution. You send your link like a parameter, get the real link from database(or other data structure) and then redirect
     
  8. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    make the link location blank and use jscript to drive web page on the mouseclick event
    but may not work if Jscript disabled, but can use php
     

Share This Page