Window.history.go () Return to previous page

Source: Internet
Author: User

1 Back to previous page JavaScript code

<body>
Sorry, the number you added already exists, please add again please click <a href=javascript:history.go ( -1);> return </a> to previous page
</body>

Or: Javascript:window.history.go (-1)

2 Window.history.go () to refresh the "up" code while returning to the previous page

Use Window.history.go (-1) to return to the previous page at the same time to refresh the "up", this is suitable for "on the page" contains dynamic update content, such as calling the Forum's new posts, call the article system's latest article and so on. If your "Up page" does not have dynamically updated content, it is recommended not to do this, others point back to the time to load again
Method 1: Force load and Refresh once
Add the following code to the page you want to load:
<script>
if (window.name!= "Bencalie") {
Location.reload ();
Window.name = "Bencalie";
}
else{
Window.name = "";
}
</script>
Method 2: Disable caching to achieve the refresh effect.
Content reference to: <meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Pragma" content= "No-cache" >
Back code: <a href= "Javascript:window.history.go ( -1)" > Back to Previous page </a>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.