How to return to the previous page and refresh the page

Source: Internet
Author: User

Use window. history. go (-1) refresh the "Previous Page" when returning to the previous page. This is suitable for "Previous Page" with dynamic updates, such as calling new posts on the Forum and calling the latest articles on the article system. If your "Previous Page" does not have dynamically updated content, we recommend that you do not perform this operation. When others attempt to return the content, they need to load it again.

Refresh once after Force Loading

Add the following code to the page to load:

<Script type = "text/javascript"> if (window. name! = "Bencalie") {location. reload (); window. name = "bencalie" ;}else {window. name = "" ;}</script>
Disable caching to achieve refresh Effect

Reference content:

<Meta http-equiv = "Expires" CONTENT = "0"> <meta http-equiv = "Cache-Control" CONTENT = "no-cache"> <meta http-equiv = "Pragma" CONTENT = "no-cache">

Back to previous page code:

<A href = "Javascript: window. history. go (-1)"> return to the previous page </a>

PHP will often use the following method, and the server will return to the previous page after processing:

$ Page = "upload. php"; echo "<script> alert ('upload successful! '); Window. location = "". $ page. ""; </script> ";

Related Article

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.