Home > Article > Web Front-end > How to hide javascript url
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.
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!