admin管理员组

文章数量:1405509

When I click on a link (or hover with a mouse), the URL shows up at the bottom of the screen. That's the default behaviour in Firefox.

How can I prevent this ?

I'm making a website for tactile interfaces.

Thanks !

When I click on a link (or hover with a mouse), the URL shows up at the bottom of the screen. That's the default behaviour in Firefox.

How can I prevent this ?

I'm making a website for tactile interfaces.

Thanks !

Share edited Nov 8, 2012 at 16:48 Mr. Alien 157k36 gold badges303 silver badges285 bronze badges asked Nov 8, 2012 at 16:38 theredledtheredled 1,05010 silver badges21 bronze badges 5
  • have you tried using jquery..? – Philemon philip Kunjumon Commented Nov 8, 2012 at 16:42
  • how can I use jquery for this ? – theredled Commented Nov 8, 2012 at 16:48
  • 3 I didn't downvote but I would imagine its because this is very much bad practice. The status bar is there to stop dodgy sites trying to fool people by linking to pages other than that written on the screen. – Simon Cunningham Commented Nov 8, 2012 at 16:58
  • Then, the one that downvoted should have asked me the reason why... It's for an Interactive kiosk and the client doesn't want any visible URL. The page should look like an app. – theredled Commented Nov 8, 2012 at 17:03
  • 1 Here is just a thought, if you really need to control this behavior, don't use firefox. Consider embedding a form of webview in whatever application language where you can control the chrome and behavior of the interface. – Quintin Robinson Commented Nov 8, 2012 at 17:05
Add a ment  | 

4 Answers 4

Reset to default 2

It would be better if you are using any other tag other than <a> if suppose you are using a

<div id='idofdiv'> tag

the query will be

$('#idofdiv').click(function(){
window.open('www.google.');
});

hope this helps!!

Browsers don`t show what object will do onClick, so try this:

<div onclick="location.href ='http://www.google.';"> click me </div>

Or you can use span which is inline element:

<span onclick="location.href ='http://www.google.';"> click me </span>

you can achieve this using jquery, first inlcude the jquery library in your page then

write the script in the page

 $(function(){
       $('[data-url]') //select all elements having data-url
        .click(function(e){ e.preventDefault();
         window.location.href= $(this).attr('data-url')})
    })

and in the html

<span data-url="#/inbox" >Go to inbox</span>
<a data-url="mydraft.html">Drafts</a>

This is not possible and CSS is nowhere here, you just cannot do it with CSS, well you can use something like this to spoof the <a> link but I suggest you don't use all this, without any specific reason, anyways they'll find the URL from the source page

<a href="#" onclick="location.href ='http://www.google.';">Spoofing</a>

Demo

Note: Actually just checked, the demo is not working on the fiddle page but just make a local .html page and it will work

本文标签: javascriptHow to disable URL tooltip (status bar)Stack Overflow