The Window Object
On the window object
HTML
<canvas id="canvas1" width="900" height="500"></canvas>
JavaScript
//The Window object
//The Window Object is the Global Object
//variables declared under it become its properties
var age = 29;
function alertAge() {
alert(this.age);
}
/*
alert(window.age); //29
alert(age);
alertAge(); //29 this points to window under global scope
*/
//open a new window and name it newWin
var newWin = window.open("http://www.radikal.com.tr", "topFrame",
"height=1330, width=400, top=10, left=20, resizable=yes");
//close the new Window
newWin.close();
//refer back to the main window that opened newWin
alert(newWin.opener == window);