I. JS: Reload the page, refresh locally, and return to the previous page.
Copy codeThe Code is as follows:
<A href = "javascript: history. go (-1)"> return to the previous page </a>
<A href = "javascript: location. reload ()"> reload the page and refresh it locally </a>
<A href = "javascript: history. go (-1); location. reload ()"> return to the reload page of the previous page and refresh the page locally </a>
Return the first two pages and refresh the JS Code.
Copy codeThe Code is as follows:
History. go (-2 );
Location. reload ();
Ii. js method
Copy codeThe Code is as follows:
<A href = "#" onclick = "self. location = document. referrer;"> return </a>
Methods for asp to automatically return and refresh:
Copy codeThe Code is as follows:
Response. Write ("<script language = javascript> self. location = document. referrer; </script> ")
It is generally used to submit an action to a page and return to the previous page and refresh it!
3. Use JS in ASP to return to the previous page and refresh the page
In ASP, JS is used to return to the previous page and refresh the page. I think it is often used to develop websites using ASP. But there are also several writing methods, but the purpose is the same.
Copy codeThe Code is as follows:
<%
Response. write ("<font color =" red "" font-size = "" 12px ""> deleted successfully! Font> ")
%>
<Div align = "center"> [<a href = "/" onClick = "javascript: window. history. go (-1); return false; "class = fontsize14> <span style =" color: # CC0033 "> return </span> </a>] </div>
The function of this Code is to inform the user that if the function has been achieved, it is best to refresh the original page to display new information or make the deleted items not displayed. However, this code cannot refresh the original webpage when it returns.
Therefore, you need to add the following code to the original page:
<Script>
If (window. name! = "Bencalie "){
// Refresh the page if its name attribute is not the specified name
Location. reload ();
Window. name = "Bencalie ";
}
Else {
// If the name attribute of the page is the specified name, nothing will be done, avoiding constant refresh.
Window. name = "";
}
</Script>
In this way, we can achieve our goal-return to the previous page and refresh it.
Of course there is more simple code than this, response. write "<script> alert ('deleted successfully! '); Window. location = 'original page'; </script>"