[Guide] to go back to the previous page and then refresh the page we use the most is in the like php,asp,jsp,asp.net, below I will give you the first to introduce JS back to the previous page and refresh the page, and then put the code in PHP to implement the deletion of the current page and refresh the page. ...
JS Reload page, refresh locally, return to previous page The code is as follows
123 |
<
a
href
=
"javascript:history.go(-1)"
>返回上一页</
a
>
<
a
href
=
"javascript:location.reload()"
>重载页面,本地刷新</
a
>
<
a
href
=
"javascript:history.go(-1);location.reload()"
>返回上一页重载页面,本地刷新</
a
>
|
Return to the first two pages and refresh the JS code should be how to write. JS method The code is as follows
1 |
<a href= "#" onclick= "self.location=document.referrer;" >返回</a> |
How the ASP automatically returns and refreshes: The code is as follows
1 |
response.Write( "<script language=javascript>self.location=document.referrer;</script>" ) |
Typically used to submit an action to a page and then return to the previous page and refresh! PHP practices The code is as follows
1 |
echo "<script>alert(‘退出成功!‘);location.href=‘" .$_SERVER[ "HTTP_REFERER" ]. "‘;</script>" ; |
Set the delete success to return to the previous page and refresh The code is as follows
12345678 |
if ($query) { $page= "listrenwu.php" ; <!---这种方式不会刷新,只会原样返回--> echo "<script>alert(‘删除成功‘);history.go(-1)</script>" ; <!-- //设置删除成功后返回前一页,并刷新-->--> echo "<script>alert(‘删除成功‘);window.location = " ".$page." ";</script>" ; } |
This is the simplest PHP tutorial, oh, not much to say you understand. |
JS returns to the previous page and refreshes the page method