5.2 Location/History/Navigator/Scree對象
本節簡介:本節課著重介紹Location/History/Navigator/Scree對象的屬性和方法。
本節課同學們做的筆記 點擊播放按鈕可自動定位到對應時間進行播放
分辨mobile true or false的代碼段
settimeout(function(){location.reload();},1000) 每一秒刷新一次當前頁面窗口文檔; settimeout(function(){location.reload();},1000) document.write(new date()) 每一秒刷新當前頁面窗口的時間。
Navigator對象屬性:userAgent 返回有客戶機發送服務器的user-agent頭部的值。
location.herf (跳轉);location.reload(重載頁面)
alert(history.length);//歷史紀錄的長度
setTimeout(function(){ location.reload()//刷新 },2000) document.write(new Date())
assign()加載新的文檔; reload()重新加載當前文檔;replace()用新的文檔替換當前文檔
settimeout(function(){},秒數)
javasctipt:history.back();向后javacript:history.forward();向前;javascript:history.go()直接返回指定頁面
location負責跳轉,操作地址欄的。reload()刷新;href()跳轉