Home  >  Article  >  Web Front-end  >  How to hide javascript url

How to hide javascript url

藏色散人
藏色散人Original
2021-06-30 10:47:324471browse

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;

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>
<script>
    function gogogo()
    {
        top.location.replace(url);
        return false;
    }
</script>

[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!

Statement:
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