@H_403_0@本文实例讲述了JavaScript常用的返回,自动跳转,刷新,关闭语句。分享给大家供大家参考。具体如下:
@H_4030@1. Javascript 返回@R301_475@:<div class="codetitle"><a style="CURSOR: pointer" data="56997" class="copybut" id="copybut56997" onclick="doCopy('code56997')"> 代码如下:
例:
<div class="codetitle"><a style="CURSOR: pointer" data="29889" class="copybut" id="copybut29889" onclick="doCopy('code29889')"> 代码如下:<div class="codebody" id="code29889"><a href="javascript:history.go(-1);">向上一页
response.Write("")
response.Write("")
<a href="javascript:history.go(-1);">向上一页
页面跳转:<div class="codetitle"><a style="CURSOR: pointer" data="56592" class="copybut" id="copybut56592" onclick="doCopy('code56592')"> 代码如下:<div class="codebody" id="code56592">onclick="window.location.href='list.aspx'"
P.S. Javascript刷新页面的几种方法:
小技巧(JS引用JS):
<div class="codetitle"><a style="CURSOR: pointer" data="76482" class="copybut" id="copybut76482" onclick="doCopy('code76482')"> 代码如下:<div class="codebody" id="code76482">
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
@H_403_0@1.页面自动刷新:把如下代码加入区域中
<div class="codetitle"><a style="CURSOR: pointer" data="43370" class="copybut" id="copybut43370" onclick="doCopy('code43370')"> 代码如下:<div class="codebody" id="code43370"><Meta http-equiv="refresh" content="20">
其中20指每隔20秒刷新一次页面.
3.页面自动刷新js版
<div class="codetitle"><a style="CURSOR: pointer" data="18140" class="copybut" id="copybut18140" onclick="doCopy('code18140')"> 代码如下:<div class="codebody" id="code18140"><script language="JavaScript">
function myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',1000); //指定1秒刷新一次
ASP.NET如何输出刷新父窗口脚本语句
1.<div class="codetitle"><a style="CURSOR: pointer" data="91841" class="copybut" id="copybut91841" onclick="doCopy('code91841')"> 代码如下:<div class="codebody" id="code91841">this.response.write("");
2.<div class="codetitle"><a style="CURSOR: pointer" data="44179" class="copybut" id="copybut44179" onclick="doCopy('code44179')"> 代码如下:<div class="codebody" id="code44179">this.response.write("");
3.<div class="codetitle"><a style="CURSOR: pointer" data="87164" class="copybut" id="copybut87164" onclick="doCopy('code87164')"> 代码如下:<div class="codebody" id="code87164">Response.Write("")
子窗口刷新父窗口:
<div class="codetitle"><a style="CURSOR: pointer" data="38839" class="copybut" id="copybut38839" onclick="doCopy('code38839')"> 代码如下:<div class="codebody" id="code38839">
或者:
如何刷新另一个框架的页面用:
如果想关闭窗口时刷新或者想开窗时刷新的话,在
中调用以下语句即可。开窗时刷新:<div class="codetitle"><a style="CURSOR: pointer" data="9594" class="copybut" id="copybut9594" onclick="doCopy('code9594')"> 代码如下:<div class="codebody" id="code9594"><body onload="opener.location.reload()">
关闭时刷新:<div class="codetitle"><a style="CURSOR: pointer" data="17476" class="copybut" id="copybut17476" onclick="doCopy('code17476')"> 代码如下:<div class="codebody" id="code17476"><body onUnload="opener.location.reload()">
<div class="codetitle"><a style="CURSOR: pointer" data="67274" class="copybut" id="copybut67274" onclick="doCopy('code67274')"> 代码如下:<div class="codebody" id="code67274"><script language="javascript">
window.opener.document.location.reload()