Please see the following code:
The code is as follows |
Copy Code |
<script type= "Text/javascript" > function GoBack () { Location.href = "http://www.111cn.net/"; } function Gobackrep () { Location.replace ("http://www.111cn.net/"); } </script> |
HTML code
<p> Click on the Back button to make the page to the homepage, you can click the browser Back button back to this page. The method used is to assign values directly to Location.href.
</p>
The code is as follows |
Copy Code |
<button onclick= "GoBack (); return false; value= Redirect to Home > redirect to Home </button> |
<p> Clicking on the Back button will also jump to the home page, but because it is using the Location.replace method, you cannot return to this page through the browser's Back button. </p>
The code is as follows |
Copy Code |
<button onclick= "Gobackrep (); return false; "value=" Redirect to Home (cannot be returned) > |
Effect
Click on the Back button to make the page to the homepage, you can click the browser Back button back to this page. The method used is to assign values directly to Location.href.