1. 程式人生 > 其它 >javascript當中history的用法

javascript當中history的用法

javascript當中history的用法

6.history
例 1.6(firstIEFF.html)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>

</HEAD>

<BODY>
<A HREF="second.html">進入second.html</A>
</BODY>
</HTML>
second.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<TITLE> New Document </TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--
/*Window.history (Property)
This property returns a history object for this window.

Property/method value type: History object
JavaScript syntax: - history
- myWindow.history

.*/
window.οnlοad=function(){
var num = Math.round(Math.random()*100);

document.getElementById("num").innerHTML=num;
}
//-->
</SCRIPT>
</HEAD>

更多內容請見原文,文章轉載自:

https://blog.csdn.net/qq_43650923/article/details/103045998