Home > Web Front-end > JS Tutorial > How to hide javascript url

How to hide javascript url

藏色散人
Release: 2021-06-30 10:47:32
Original
4516 people have browsed it

Javascript method to implement url hiding: first create the test.js file; then load the js file in the web page; finally pass "function gogogo(){top.location.replace(url);return false;}" Just hide it.

How to hide javascript url

The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.

How to hide javascript url?

Hide the URL in the web page through JS

Js files such as test.js are written

var url="https://www.baidu.com/";
var time="0.006511926651001";
var top_text="";
var img_url="";
var bottom_text="";
var can_show=true;
Copy after login

Load js files in the web page

Similarly written in the web page Enter

 <div class="intro-button">
    <a onclick="gogogo();return false;" href="javascript:void(0)" class="btn btn-lg btn-custom">GET FOLLOWERS NOW</a>
 </div>
Copy after login
<script>
    function gogogo()
    {
        top.location.replace(url);
        return false;
    }
</script>
Copy after login

[Related recommendations: javascript advanced tutorial]

The above is the detailed content of How to hide javascript url. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template