BOM(Browser Object Model)
- 瀏覽器(window)提供的物件原型。
名稱 | 中文 |
---|---|
history | 瀏覽歷史紀錄 |
frames | 框架 |
location | 路徑位置 |
document | DOM元素 |
screen | 使用裝置資訊 |
navigator | 版本資訊 |
回上頁
- 使用window.history.forward(),下一頁。
- 使用window.history.back(),回上頁。
回上頁前必須先下一頁
|
|
列印
|
|
前往網址
- window.open(“網址”),會另開新視窗。
- location.href=“網址”,使用當前視窗。
|
|
瀏覽器高度
- window.innerHeight,可以取得瀏覽器可視高度。
- window.outerHeight,可以取得整個瀏覽器高度。
- window.onresize,當拖動瀏覽器時觸發。
可以使圖片滿版整個頁面
|
|