JS return and refresh, ASP return and refresh
I:
JS reload page, local refresh, back to previous page
<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 to the first two pages and refresh the JSCodeHow to write.
II:
JS method: <a href = "#" onclick = "self. Location = Document. referrer;"> return </a>
Methods for ASP to automatically return and refresh:
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!
III:
Use Js in ASP to return to and refresh the previous 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.
<%
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>"
Reprinted: http://hi.baidu.com/snss324/item/2869fdfeb134d65dc8f3373b