Hiding URLs in the status bar of any browser...

This area is only for programmers, All codings, programming tips and tricks, hacks related to any programming language.

Hiding URLs in the status bar of any browser...

Postby WebMaster » Wed Jun 30, 2010 2:26 am

Today, I saw my status bar is showing the actual URL, when I opened a site in my browser. I thought, Ah, What's this ! Can this be hidden? I googled and saw some interesting JavaScript code to hide the display of those URLs in status bar of any browser. I thought you must also know this technique...
Actually this URL display occurs in your status bar when your mouse comes over a link (hover position of a mouse over a link), This is a very useful technique if you want to display a different URL instead of actual URL in any browser's status bar.

Assume for the link: www.etdsonline.com, if i would place a link the html code will be -
<a href="www.etdsonline.com" target="_blank" onMouseOver="window.status='http://www.etdsonline.com/news'; return true" onMouseOut="window.status=''">eTDS TechnoSys</a>

The above html code will display http://www.etdsonline.com/news instead of the actual url http://www.etdsonline.com.

To change the status bar text of the the link in Firefox and Safari you’ve to just use a small technique with the help of “href” and “Onclick” attribute of the hyper-link. Let’s look at the this technique step by step:

  1. First of all make a JavaScript function exactly as shown below:
    <script language="javascript" type="text/javascript">
    function redirect(URL)
    {
    document.location=URL;
    return false;
    }
    </script>

  2. Now, define the hyper-link with the status bar text in href attribute and call the above function from onClick attribute of the link like below:

    <a href="http://www.etdsonline.com" onclick="return
    redirect('http://www.etdsonline.com/news');">eTDS TechnoSys</a>
Please note that this technique will not work if JavaScript has been disabled in the browsers, but don't worry most of the browsers today have JavaScript enabled.
User avatar
WebMaster
Administrator
Administrator
 
Posts: 31
Joined: Thu Jun 03, 2010 7:41 pm
Location: INDIA

Return to Programmers Zone

Who is online

Users browsing this forum: No registered users and 1 guest

Support us promoting this forum, keep posting. If you are interested in donations then please click here

NOTE: We are continuously updating our main site and forums, please feel free to post articles, news, your life story and anything you like, but please follow forum rules unless you will be banned forever and so grouped under. We recommend you to read WebMaster Postings And Announcements before posting or reading anything else. We request you kindly to report us immediately if any video on any of the forum is not playing/working properly by clicking the 'Report this post' option on top of every post.
cron

Valid CSS! Valid XHTML 1.0 Transitional Creative Commons License