window.open()
:打開窗口。返回一個指向新窗口的引用。window.close()
:關閉窗口。window.resizeTo()
:調整窗口尺寸到指定值window.resizeBy()
:增長窗口尺寸,增長量爲指定值window.moveTo()
:移動窗口window.moveBy()
:移動窗口,座標增長量爲指定值window.innerHeight
:瀏覽器窗口的內部高度window.innerWidth
:瀏覽器窗口的內部寬度window.setTimeout()
:超時調用window.clearTimeout()
:取消超時調用window.setInterval()
:間歇調用window.clearInterval()
:取消間歇調用window.alert()
:警告框window.confirm()
:確認對話框。返回布爾值,點擊肯定返回true,點擊取消返回falsewindow.prompt()
:提示框。點擊肯定返回文本框的值,點擊取消返回nullwindow.print()
:打印對話框window.find()
:查找對話框location.href
:完整URL,如http://www.bnu.edu.cn:8080/path/to/homepage/index.html?name='peter'&age='20'#contents
location.protocol
:協議名,如http:
location.hostname
:服務器名,如www.bnu.edu.cn
location.host
:服務器名及端口號,如www.bnu.edu.cn:8080
location.port
:端口號,如8080
location.pathname
:目錄和文件名,如/path/to/homepage/index.html
location.search
:查詢字符串,以問好開頭,如?name='peter'&age='20'
location.hash
:散列值,即#號後面,如#contents
location.assign()
:打開指定URL,並在歷史記錄中生成一條記錄。等價於location.href = URL
和window.location = URL
。location.replace()
:打開指定URL,但不生成新的歷史記錄。location.reload()
:從新加載當前頁面。默認以最有效的方式加載,可能會請求到緩存。location.reload(true)
:從新加載當前頁面,強制從服務器從新加載。navigator.userAgent
:用戶代理字符串navigator.plugins
:安裝插件信息的數組navigator.onLine
:檢測設備在線仍是離線screen.availWidth
:可用的屏幕寬度。以像素計,減去界面特性,好比窗口任務欄。screen.availHeight
:可用的屏幕高度。以像素計,減去界面特性,好比窗口任務欄。screen.width
:屏幕的像素寬度screen.height
:屏幕的像素高度screen.colorDepth
:顏色位數history.go()
:跳轉到任意歷史記錄。
history.back()
:後退一頁history.forward()
:前進一頁history.length
:歷史記錄的數量。對於窗口中第一個打開的頁面而言,其history.length爲0。history.pushState()
:歷史狀態管理。將新的狀態信息加入歷史狀態棧。history.replaceState
:歷史狀態管理。重寫歷史狀態。參考自:《JavaScript高級程序設計》、W3schoolhtml