Browsers feature a Browser Object Model (BOM) that allows access and manipulation of the browser window i.e. it allows JavaScript to "talk to" the browser. Using the BOM, developers can move the ...
新開的 window 可以用 window.opener 存取到開啟它的 window,這個功能我之前在 從 SessionStorage 開始一場 spec 之旅 中有提到過。 然後, window.open 傳入的第二個參數就會是這個新的 window 的 name,舉例來說,如果我在新開的 window 執行 console.log(window.name),就會印出 huliblog。