Method
|
Description
|
Example
|
.write (sText)
|
Write a String Text with HTML format at the first of the page
|
document.write ('<br>salam')
|
.execCommand (cmdID)
|
Does a command like saving as or refreshing the page.
|
document.execCommand ('Print')
document.execCommand ('SaveAs') |
Method
|
Description
|
Example
|
.alert ([message])
|
'alert' function. The message is optional.
|
window.alert ('Hellow')
|
.blur()
|
Hides the window.
|
window.blur ()
|
.close ()
|
Closes the window after asking a question.
|
window.close ()
|
.confirm ([message])
|
A Message Box with OK-Cancel buttons.
|
window.confirm ('The window is Restarted.')
|
.moveTo (x,y)
|
Moves the window to the specified position
|
window.moveTo (80,80)
|
.moveBy (x,y)
|
Moves the window base on the current position
|
window.moveBy (90,90)
|
.navigate (url)
|
Opens the url (Address) in the page (go
|
window.navigate ('http://www.javascriptfreecode.com')
|
.open ([url])
|
Opens a new page (Blank if no url is specified)
|
window.open ('http://www.javascriptfreecode.com')
|
.prompt([message], [defstr])
|
Opens A box to ask a message (optional) with an initial optional value 'defstr'
|
window.prompt ('Your Age?', 22)
|
.resizeTo (x,y)
|
Resize the window to defined size (x=width, y=height)
|
window.resizeTo (800,500)
|
.resizeBy (x,y)
|
Add x to the current width and y to the current height of the page.
|
window.resizeBy (-80,220)
|
.setTimeout (expression, msec)
|
Does an expression (JavaScript code here) cyclically after an interval (millisecond period)
|
window.setTimeout ("alert ('salam')" ,3000)
|
.setInterval (expression, msec)
|
Does an expression one time after an interval (millisecond period)
|
window.setInterval ("alert ('salam')" ,3000)
|