Thursday, October 27, 2011

Javascript top Object

window object is the top one.it will be created after user open a browser,or we can create sub windows from current window.we can also refer to its properties(property and method),
like we can call following method:
var subwindow = window.open("define.html","def","height=200,width=300")
subwindow.close()
window.alert("the is a javascript alert dialog")
if(window.confirm("Are you sure you want to start over?")
{
location.href="index.html"
}

the word window could be ommited.
var answer = prompt("What is your name?","");
if (answer)
{
alert("Hello, " + answer + "!");
}

window.addEventListener(’load’, functionName, false);
window.attachEvent(’onload’, functionName);

navigator object represents the URL of the current window

No comments:

Post a Comment