To be short, today I will introduce a method to implement this function. Friends who need to know can refer to it:
1. JS reload page, refresh locally, return to the previous page
The code is as follows:
<a href="javascript:(-1)">Return to the previous page</a> <a href="javascript:()">Reload the page,Local refresh</a> <a href="javascript:(-1);()">Return to the previous pageReload the page,Local refresh</a>
How should I write the JS code that returns to the first two pages and refreshes.
The code is as follows:
(-2);
();
2. js method
The code is as follows:
<a href="#" onclick="=;">Return</a>
How to automatically return and refresh asp:
The code is as follows:
("<script language=javascript>=;</script>")
It is generally used to submit an action to a page and return to the previous page and refresh it!
Return to the previous page (-1), return to two pages: (-2);
().
() Return to the next page
(Return to the page, you can also use the visited URL)
example:
<a href="javascript:(-1);">Up to the previous page</a> ("<script language=javascript>") ("if(!confirm('Complete the task?')){();}") ("</script>") ("<script language=javascript>(-1);</script>") <a href="javascript:(-1);">Up to the previous page</a> Page jump:onclick="=''"
.
Tips (JS quotes JS):
<script type=text/javascript> <!-- if (typeof SWFObject == "undefined") { ('<scr' + 'ipt type="text/javascript" src="/scripts/swfobject-1."></scr' + 'ipt>');} //--> </script>
Several ways to refresh pages in Javascript:
1 (0)
2 ()
3 location=location
4 (location)
5 ('Refresh')
6 (location)
7 (location)
8 =
Methods to automatically refresh the page:
1. Automatic page refresh: add the following code to the area
<meta http-equiv="refresh" content="20">
20 of them refer to refreshing the page every 20 seconds.
2. Automatic page jump: add the following code to the <head> area
<meta http-equiv="refresh" content="20;url=">
20 fingers jump topage
3. Automatic page refresh
<script language="JavaScript"> function myrefresh() { (); } setTimeout('myrefresh()',1000); //Specify refresh once in 1 second</script>
How to output a refresh parent window script statement
1. ("<script>();</script>");
2. ("<script> = ;</script>");
3. ("<script language=javascript>(''The page you want to refresh.asp'');</script>")
JS refresh framework script statement
//How to refresh the page containing the frame<script language=JavaScript> (); </script> //The child window refreshes the parent window<script language=JavaScript> (); </script> ( or <a href="javascript:()">refresh</a> ) //How to refresh the page of another frame<script language=JavaScript> parent.another(); </script>
If you want to refresh when the window is closed or refresh when the window is opened, just call the following statement.
<body onload="()"> Refresh when opening the window <body onUnload="()"> Refresh when closed <script language="javascript"> () </script>
3. Use JS in ASP to return to the previous page and refresh
I think it is often used when using ASP to develop websites using ASP. But there are several ways to write, but the purpose is the same.
The code is as follows:
<% ("<font color=""red"" font-size=""12px"">Deleted successfully!font>") %> <div align="center">[<a href="/"onClick="javascript :(-1);return false;" class=fontsize14><span style="color: #CC0033">Return</span></a>]</div>
The function implemented by this code is to inform the user that the function implemented has been achieved, but when returning, it is best to refresh the original page so that the new information is displayed or that the deleted things are not displayed. However, this code cannot refresh the original web page when it returns.
So you need to add a piece of code to the original page:
<script> if( != "Bencalie"){ //Refresh the page's name attribute if it is not the specified name(); = "Bencalie"; } else{ //If the name attribute of the page is the specified name, do nothing to avoid continuous refresh = ""; } </script>
This will achieve our goal – return to the previous page and refresh.
Of course there is a simpler code than this.
("<script>alert('Delete successfully!');='Original page';</script>");
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.