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 ();