1。JavaScriptは前のページhistory.go(-1)に戻り、2ページを返します。history.go(-2);
2。history.back()。
3。Window.history.forward()は次のページに戻ります
4。Window.history.go(ページに戻る、訪問したURLを使用することもできます)
例:
<a href = javascript:history.go(-1);>前のページ</a>
respons.write(<スクリプト言語= javascript>)
respons.write(if(!confism( 'the Complete the task?')){history.back();})
respons.write(</script>)
Response.write(<スクリプト言語= javascript> history.go(-1); </script>)
<a href = javascript:history.go(-1);>前のページ</a>
ページジャンプ:onclick = window.location.href = 'list.aspx'
詩
ヒント(JS引用JS):
<script type = text/javascript>
<! -
if(typeof swfobject == undefined){
document.write( '<scr' + 'ipt type = text/javascript src =/scripts/swfobject-1.5.js> </sc +' ipt> ');}
//->
</script>
JavaScriptでページを更新するいくつかの方法:
1 history.go(0)
2 location.reload()
3場所=場所
4 location.Assign(場所)
5 document.execcommand( 'refresh')
6 Window.Navigate(場所)
7 location.replace(場所)
8 document.url = location.href
ページを自動的に更新する方法:
1。自動ページの更新:次のコードを<head>領域に追加します
<メタhttp-equiv = content = 20>を更新します
20秒ごとにページの更新を指します。
2。自動ページジャンプ:次のコードを<head>領域に追加します
<Meta http-equiv = reffress content = 20; url = http://www.javaeye.com>
その中で、20秒後に20本の指がhttp://www.javaeye.comにジャンプします。
3.自動ページの更新
<スクリプト言語= javascript>
機能myrefresh()
{
window.location.reload();
}
setimeout( 'myrefresh()'、1000); // 1秒で1回更新を指定します
</script>
更新された親のウィンドウスクリプトステートメントを出力する方法
1。this.response.write(<scrip> opener.location.reload(); </script>);
2。this.response.write(<script> opener.window.location.href = opener.window.location.href; </script>);
3。respons.write(<スクリプト言語= javascript> opener.window.navigate( '' page.asp ''); </script>)
JS更新フレームワークスクリプトステートメント
//フレームを含むページを更新する方法
<スクリプト言語= javascript>
parent.location.reload();
</script>
//チャイルドウィンドウは親ウィンドウを再表示します
<スクリプト言語= javascript>
self.opener.location.reload();
</script>
(または<a href = javascript:opener.location.reload()>更新</a>)
//別のフレームのページを更新する方法
<スクリプト言語= javascript>
parent.another frameid.location.reload();
</script>
窓が閉じたときに更新する場合、またはウィンドウが開いたときに更新する場合は、<body>で次のステートメントを呼び出してください。
<body onload = opener.location.reload()>ウィンドウを開くときに更新します
<body onunload = opener.location.reload()>閉じたときに更新します
<スクリプト言語= javascript>
window.opener.document.location.reload()
</script>