Delete destination Url of link on the bottom of browser's page

£可爱£侵袭症+ 提交于 2020-01-06 19:01:20

问题


In every browsers, when I stay with the cursor on a clickable link, in the bottom of the page is showed the destination of this link, where I'll be redirected on click. Is it possible to hide this with jQuery? Is also possible to hide the address bar or set it blank, in order to hide the actual page? ( for example showing only the domain name) thanks


回答1:


You can do this, or a variation of this:

Having a link like this one:

<a href="#" id="mylink">click here</a>

Then with jquery you can set where it will go on click:

$(document).ready(function() {
            var where_to = "http://www.google.com";
            $('#mylink').on('click', function(event) {
                event.preventDefault();
                 document.location.href = where_to;
            })
        });

And this way on roll over the link, no location will be displayed in the status bar.

EDIT: And for the address bar content, to hide the actual name of the script, you can have a look at .htaccess rewrite rules, do a search on the web.




回答2:


No, this is not possible... at least not yet. The window.status property doesn't appear to work in most browsers, and even then in regards to firefox, it will only work if an option is enabled in the browser's settings. You will have to do a sort of work-around. From a bit of research, I found this work-around.

Something like the below will also work(eg, another workaround):

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


来源:https://stackoverflow.com/questions/11357189/delete-destination-url-of-link-on-the-bottom-of-browsers-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!