

<form name="fname">
<script Language="Javascript">
<!-- °¨Ãã½ÃÀÛ
var numb=history.length;
document.write('history.length=[<font color=blue>' + numb +
'</font>] ¹æ¹® ³»¿ë¿¡ µû¶ó °è¼Ó ´Þ¶óÁü<br>');
for (i=-numb; i<3; i++){
string='';
if (i==0) string='<input type="button" disabled value="Çö Àç 0"'
else if (i>0) string='<input type="button" value="ÀÌ ÈÄ '
else string='<input type="button" value="ÀÌÀü '
string+=i+'" °·Î onclick="history.go('+i+')">'+
' <a href="javascript:history.go('+i+
')">javascript:history.go('+i+')</a><br>';
document.write(string);
}
document.write('<br><input type="button" value="¹Ù·ÎÀÌÀü"'+
' onclick="history.back()"> <a href="javascript:history.back()">'+
'javascript:history.back()</a><br>');
document.write('<input type="button" value="¹Ù·Î´ÙÀ½"'+
' onclick="history.forward()"> <a href="javascript:history.forward()">'+
'javascript:history.forward()</a><br>');
// °¨Ãã ³¡ -->
</script>
</form>
Áß¿ä »çÇ×
- history.length·Î Àüü ¹æ¹® Çß´ø ±â·ÏÀÇ °¹¼ö¸¦ ¾Ë ¼ö ÀÖ´Ù. ¿©±â¼ 0Àº ÇöÀç À§Ä¡ÀÌ´Ù.
- for loop¿¡¼, °¢ ¹æ¹® ±â·ÏÀ» INPUTÀÇ history.go(n)(onclick="history.go(',i,')")·Î ¿¬°áÇÑ´Ù.
- À̶§ ÇÊ¿äÇÑ INPUTÀÇ attributeÀÇ °ªÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
- history.back()°ú history.forward()´Â ´Ü¼øÈ÷ ¹Ù·Î ¾Õ°ú µÚ·Î ¿¬°á ½ÃŲ´Ù.
- ¹æ¹®ÇÏÁö ¾ÊÀº µÚÂÊ ¿¬°áÀº ¹«½ÃµÈ´Ù.
- disabled·Î ÀÛµ¿À» ÁßÁö ½Ãų ¼ö ÀÖ´Ù.
|