JS to return to the previous page and refresh

Source: Internet
Author: User

Today, I wrote a small page indicating that the page was successful. At the same time, I asked to return to the previous page and refresh the operations on the previous page (for example, deleted or added). I searched the page online, basically, 90% is about window. history. go (-1 ),
Or use window. History. Back (-1), or use the sub-page to refresh the parent page

<Script language = javasLatency>

   Self. opener. Location. Reload ();

</SCRIPT>

After testing on the JSP page, select the added items on the Operation page and click the Save button to jump to the success prompt page. The items are not refreshed and displayed only after manual refreshing, it is really sad to see the articles that do not pass tests on the copy and paste technology.

In fact, I have not found any way to implement this technology by relying entirely on JS. The idea is to keep the previous page from being cached and read it every time (other people's ideas, I have not understood the principle)

The JSP implementation method is as follows:

<%String rec = request.getHeader("REFERER");%><input type="button" onclick="javascript:window.location='<%=ref%>'">


The ASP page is implemented as follows:

<% 'Get the address of the previous page
Address = request. servervariables ("http_referer ")
%>
<! -- Window. location has the function of returning relative pages and refreshing -->
<A href = "javascript: window. Location. href = '<% = address %>'" style = "cursor: Hand"> return </a>


. In the Servlet request. getrequestdispatcher (request. getheader ("Referer"). Forward (request, response); or request. getrequesturl ();


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.