履歴を操作する
| <html> <head> </head> <body> <script language="JavaScript"> <!-- function fncJump(){ intJumpNum = window.prompt("ジャンプ先No.は?","0"); history.go(intJumpNum); } //--> </SCRIPT> <center> <hr>履歴移動バー<hr> <script language="JavaScript"> <!-- document.write("<br>現在" + history.length + "つの履歴があります。<br>"); //--> </SCRIPT> ボタンをクリックするとページ移動することができます。 <form name="form1"> <input type="button" name="btnBack" value="Back" onclick="history.back()"> <input type="button" name="btnBack" value="Forward" onclick="history.forward()"> <input type="button" name="btnBack" value="Go" onclick="fncJump()"> </form> </center> </body> </html> |
| 【解説】 ここは講義の通りなので解説はあまりないのですが、 goの履歴移動は、+で進む、−で戻るです。 |