1. 程式人生 > >關於JavaScript的window物件的status屬性

關於JavaScript的window物件的status屬性

程式碼示例如下:
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus?">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>狀態列顯示當前時間</title>
 </head>
<script type="text/javascript">
<!--
function init(){
//拿到當前時間
var d = new Date() ;
//設定狀態列的文字
self.status = d.toLocaleString() ;   //self和window是等價的     //status:設定狀態列的文字


setTimeout("init()",1000) ;
}
//-->
</script>
 <body onload = "init()">
     
 </body>
</html>

在瀏覽器的左下角可以看到其執行結果如下: