Window: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "NSB/App Studio programs run within a special version of a web browser. As a result, they can inherit a lot of the properties of the environment they run in. You can access t...")
 
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
NSB/App Studio programs run within a special version of a web browser.  
NSB/AppStudio programs run within a special version of a web browser.  
As a result, they can inherit a lot of the properties of the environment they run in.  
As a result, they can inherit a lot of the properties of the environment they run in.  
You can access these properties from within your app.
You can access these properties from within your app.
Line 8: Line 8:


{| class="wikitable"
{| class="wikitable"
|-
|applicationCache || An object with the status of the application cache.
|-
|applicationCache.status || The current status of the cache. If 1, an update is pending.
|-
|-
|body || The body of the window
|body || The body of the window
Line 62: Line 66:
|-
|-
|top || Returns the topmost browser window
|top || Returns the topmost browser window
|}
[[Category:Language Reference]]
[[Category:Objects]]
NSB/App Studio programs run within a special version of a web browser.
As a result, they can inherit a lot of the properties of the environment they run in.
You can access these properties from within your app.
It is not a complete list: there are additional items in the full HTML documentation. In addition, some browsers may have additional members not shown here.
'''window object members'''
{| class="wikitable"
|-
|-
|body || The body of the window
|alert() || Displays an alert box with a message and an OK button
|-
|-
|closed || Returns a Boolean value indicating whether a window has been closed or not
|blur() || Removes focus from the current window
|-
|clearInterval() || Clears a timer set with setInterval()
|-
|clearTimeout() || Clears a timer set with setTimeout()
|-
|close() || Closes the current window
|-
|confirm() || Displays a dialog box with a message and an OK and a Cancel button
|-
|createPopup() || Creates a pop-up window
|-
|focus() || Sets focus to the current window
|-
|moveBy() || Moves a window relative to its current position
|-
|moveTo() || Moves a window to the specified position
|-
|-
|defaultStatus || Sets or returns the default text in the statusbar of a window
|open() || Opens a new browser window
|-
|-
|devicePixelRatio || The number of pixels the device has for each one the browser uses.
|print() || Prints the content of the current window
|-
|-
|document || Returns the Document object for the window (See Document object)
|prompt() || Displays a dialog box that prompts the visitor for input
|-
|-
|frames || Returns an array of all the frames (including iframes) in the current window
|resizeBy() || Resizes the window by the specified pixels
|-
|-
|history || Returns the History object for the window
|resizeTo() || Resizes the window to the specified width and height
|-
|-
|innerHeight || Sets or returns the the inner height of a window's content area
|scroll() ||  
|-
|-
|innerWidth || Sets or returns the the inner width of a window's content area
|scrollBy() || Scrolls the content by the specified number of pixels
|-
|-
|length || Returns the number of frames (including iframes) in a window
|scrollTo() || Scrolls the content to the specified coordinates
|-
|-
|location || Returns the Location object for the window
|setInterval() || Calls a function or evaluates an expression at specified intervals (in milliseconds)
|-
|-
|name || Sets or returns the name of a window
|setTimeout() || Calls a function or evaluates an expression after a specified number of milliseconds
|}
 
'''window object events'''
 
Not all events occur in all browsers. The version of the browser may also influence which are active.
{| class="wikitable"
|-
|-
|opener || Returns a reference to the window that created the window
|onabort() || Script for abort events on the window.
|-
|-
|orientation || Returns the current screen rotation (0,90,180,-90)
|onbeforeunload() || Script for before-unload events on the window.
|-
|-
|outerHeight || Sets or returns the outer height of a window, including toolbars/scrollbars
|onblur() || Script for blur events on the window.
|-
|-
|outerWidth || Sets or returns the outer width of a window, including toolbars/scrollbars
|onchange() || Script for change events on the window.
|-
|-
|pageXOffset || Returns the pixels the current document has been scrolled (horizontally) from the upper left corner of the window
|onclick() || Script for click events on the window.
|-
|-
|pageYOffset || Returns the pixels the current document has been scrolled (vertically) from the upper left corner of the window
|onclose() || Script for handling the window close event.
|-
|-
|parent || Returns the parent window of the current window
|oncontextmenu() || Script for right-click events on the window.
|-
|-
|screen || Returns the Screen object for the window (See Screen object)
|ondevicelight() || Script for any ambient light levels changes
|-
|-
|screenLeft || Returns the x coordinate of the window relative to the screen
|ondeviceorientation() || Script for any device orientation changes
|-
|-
|screenTop || Returns the y coordinate of the window relative to the screen
|ondeviceproximity() || Script for device proximity event
|-
|-
|screenX || Returns the x coordinate of the window relative to the screen
|ondragdrop() || Script for drag and drop events on the window.
|-
|-
|screenY || Returns the y coordinate of the window relative to the screen
|onerror() || Script for errors raised on the window.
|-
|-
|self || Returns the current window
|onfocus() || Script for focus events on the window.
|-
|-
|status || Sets the text in the statusbar of a window
|onhashchange() || Script for hash change events on the window; called when the part of the URL after the hash mark ("#") changes.
|-
|-
|top || Returns the topmost browser window
|onkeydown() || Script for keydown events on the window.
|-
|-
|alert() || Displays an alert box with a message and an OK button
|onkeypress() || Script for keypress events on the window.
|-
|-
|blur() || Removes focus from the current window
|onkeyup() || Script for keyup events on the window.
|-
|-
|clearInterval() || Clears a timer set with setInterval()
|onload() || Script for window loading.
|-
|-
|clearTimeout() || Clears a timer set with setTimeout()
|onmousedown() || Script for mousedown events on the window.
|-
|-
|close() || Closes the current window
|onmousemove() || Script for mousemove events on the window.
|-
|-
|confirm() || Displays a dialog box with a message and an OK and a Cancel button
|onmouseout() || Script for mouseout events on the window.
|-
|-
|createPopup() || Creates a pop-up window
|onmouseover() || Script for mouseover events on the window.
|-
|-
|focus() || Sets focus to the current window
|onmouseup() || Script for mouseup events on the window.
|-
|-
|moveBy() || Moves a window relative to its current position
|onmozbeforepaint() || Script for the MozBeforePaint event, which is sent before repainting the window if the event has been requested by a call to the Window.mozRequestAnimationFrame() method.
|-
|-
|moveTo() || Moves a window to the specified position
|onpaint() || Script for paint events on the window.
|-
|-
|open() || Opens a new browser window
|onpopstate() || Script for popstate events, which are fired when navigating to a session history entry representing a state object.
|-
|-
|print() || Prints the content of the current window
|onreset() || Script for reset events on the window.
|-
|-
|prompt() || Displays a dialog box that prompts the visitor for input
|onresize() || Script for window resizing.
|-
|-
|resizeBy() || Resizes the window by the specified pixels
|onscroll() || Script for window scrolling.
|-
|-
|resizeTo() || Resizes the window to the specified width and height
|onselect() || Script for window selection.
|-
|-
|scroll() ||  
|onsubmit() || Script for submits on window forms.
|-
|-
|scrollBy() || Scrolls the content by the specified number of pixels
|onunload() || Script for unload events on the window.
|-
|-
|scrollTo() || Scrolls the content to the specified coordinates
|onuserproximity() || Script for user proximity events
|-
|-
|setInterval() || Calls a function or evaluates an expression at specified intervals (in milliseconds)
|onpageshow() || Script for pageshow events on the window.
|-
|-
|setTimeout() || Calls a function or evaluates an expression after a specified number of milliseconds
|onpagehide() || Script for pagehide events on the window.
|-
|-
|onorientationchange() || Script to be run if the screen is rotated.
|onvisibilitychange(v) || Script to run if the screen is shown or hidden. Returns True or False.
|}
|}



Latest revision as of 12:36, 19 March 2015

NSB/AppStudio programs run within a special version of a web browser. As a result, they can inherit a lot of the properties of the environment they run in. You can access these properties from within your app.

It is not a complete list: there are additional items in the full HTML documentation. In addition, some browsers may have additional members not shown here.

window object members

applicationCache An object with the status of the application cache.
applicationCache.status The current status of the cache. If 1, an update is pending.
body The body of the window
closed Returns a Boolean value indicating whether a window has been closed or not
defaultStatus Sets or returns the default text in the statusbar of a window
devicePixelRatio The number of pixels the device has for each one the browser uses.
document Returns the Document object for the window (See Document object)
frames Returns an array of all the frames (including iframes) in the current window
history Returns the History object for the window
innerHeight Sets or returns the the inner height of a window's content area
innerWidth Sets or returns the the inner width of a window's content area
length Returns the number of frames (including iframes) in a window
location Returns the Location object for the window
name Sets or returns the name of a window
opener Returns a reference to the window that created the window
orientation Returns the current screen rotation (0,90,180,-90)
outerHeight Sets or returns the outer height of a window, including toolbars/scrollbars
outerWidth Sets or returns the outer width of a window, including toolbars/scrollbars
pageXOffset Returns the pixels the current document has been scrolled (horizontally) from the upper left corner of the window
pageYOffset Returns the pixels the current document has been scrolled (vertically) from the upper left corner of the window
parent Returns the parent window of the current window
screen Returns the Screen object for the window (See Screen object)
screenLeft Returns the x coordinate of the window relative to the screen
screenTop Returns the y coordinate of the window relative to the screen
screenX Returns the x coordinate of the window relative to the screen
screenY Returns the y coordinate of the window relative to the screen
self Returns the current window
status Sets the text in the statusbar of a window
top Returns the topmost browser window
alert() Displays an alert box with a message and an OK button
blur() Removes focus from the current window
clearInterval() Clears a timer set with setInterval()
clearTimeout() Clears a timer set with setTimeout()
close() Closes the current window
confirm() Displays a dialog box with a message and an OK and a Cancel button
createPopup() Creates a pop-up window
focus() Sets focus to the current window
moveBy() Moves a window relative to its current position
moveTo() Moves a window to the specified position
open() Opens a new browser window
print() Prints the content of the current window
prompt() Displays a dialog box that prompts the visitor for input
resizeBy() Resizes the window by the specified pixels
resizeTo() Resizes the window to the specified width and height
scroll()
scrollBy() Scrolls the content by the specified number of pixels
scrollTo() Scrolls the content to the specified coordinates
setInterval() Calls a function or evaluates an expression at specified intervals (in milliseconds)
setTimeout() Calls a function or evaluates an expression after a specified number of milliseconds

window object events

Not all events occur in all browsers. The version of the browser may also influence which are active.

onabort() Script for abort events on the window.
onbeforeunload() Script for before-unload events on the window.
onblur() Script for blur events on the window.
onchange() Script for change events on the window.
onclick() Script for click events on the window.
onclose() Script for handling the window close event.
oncontextmenu() Script for right-click events on the window.
ondevicelight() Script for any ambient light levels changes
ondeviceorientation() Script for any device orientation changes
ondeviceproximity() Script for device proximity event
ondragdrop() Script for drag and drop events on the window.
onerror() Script for errors raised on the window.
onfocus() Script for focus events on the window.
onhashchange() Script for hash change events on the window; called when the part of the URL after the hash mark ("#") changes.
onkeydown() Script for keydown events on the window.
onkeypress() Script for keypress events on the window.
onkeyup() Script for keyup events on the window.
onload() Script for window loading.
onmousedown() Script for mousedown events on the window.
onmousemove() Script for mousemove events on the window.
onmouseout() Script for mouseout events on the window.
onmouseover() Script for mouseover events on the window.
onmouseup() Script for mouseup events on the window.
onmozbeforepaint() Script for the MozBeforePaint event, which is sent before repainting the window if the event has been requested by a call to the Window.mozRequestAnimationFrame() method.
onpaint() Script for paint events on the window.
onpopstate() Script for popstate events, which are fired when navigating to a session history entry representing a state object.
onreset() Script for reset events on the window.
onresize() Script for window resizing.
onscroll() Script for window scrolling.
onselect() Script for window selection.
onsubmit() Script for submits on window forms.
onunload() Script for unload events on the window.
onuserproximity() Script for user proximity events
onpageshow() Script for pageshow events on the window.
onpagehide() Script for pagehide events on the window.
onvisibilitychange(v) Script to run if the screen is shown or hidden. Returns True or False.