Uploaded on Dec 12, 2022
5 (6 files merged)
wi ndow
Object
The window object represents a window in
browser.
An object of window is created automatically
by the browser.
The important methods of window object are as
follows:
Method Descr
alert() displays thei a[lterJt btoixo co nntaining message with ok button.
confirm() displays the confirm dialog box containbinugtt omne.ssage with ok and cancel
[!ro m[!t() dis(!Jlans a dialo box to et inl!ut from the user.
o(fJen( opens the new window.
c) lose() closes the current window.
setTimeout() perform action after specified time like calling function, evaluating
ex!!Jressions etc.
Next
History Object
ry
• The JavaScript history object represents an array of URLs visited
by the user.
• By using this object, you can load previous, forward or any
particular page.
• There are only 1property of history object.
• lengt h - returns the length of the history
URLs.
• There are only 3 methods of history object.
a. forw ard() - loads the next page.
b. back() - loads the previous page.
c. go() - loads the given page number.
history.back(); //for previous page history.for-ward(); //for next page
history.go(2); //for next 2nd page
history.go(-2); //for previous 2nd page Next
Navigator Object
The JavaScript navigator object is used for
browser detection.
It can be used to get browser information such as
appName, appCodeName, userAgent etc.
There are many properties of Navigator object that
returns information of the browser.
a.appName - returns the name.
b.appVersion - returns the code name.
c.appCodeName - returns the code name. etc...
document.:.1 it c l 11 " < br/ > navigator.appCodeName: " +navigator.appCodeName) ;
document. .1it cil 11 " < br/ > navigator.appName: " +navigator.appName);
document. .1it c l 11 "< br/ > navigator.appVer sion: "+ navigator.appVersion);
document. .1it c:l 11 "< br/ > navigator.language: " +navigator .language);
wi ndow
Object
The window object represents a window in
browser.
An object of window is created automatically
by the browser.
The important methods of window object are as
follows:
Method Descr
alert() displays thei a[lterJt btoixo co nntaining message with ok button.
confirm() displays the confirm dialog box containbinugtt omne.ssage with ok and cancel
[!ro m[!t() dis(!Jlans a dialo box to et inl!ut from the user.
o(fJen( opens the new window.
c) lose() closes the current window.
setTimeout() perform action after specified time like calling function, evaluating
ex!!Jressions etc.
Thank
You! !!
Comments