edit-article
Home
Up
Delete
Article Name:
Article Description:
properties and methods of the window object, including
Chapter ID/Name:
Status:
Write
Writing
Written
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">objects - browser - window</h1> <h2>[WHAT]</h2> <ol> <li>] <span class="seoSummary">The <code>window</code> object represents a window containing a DOM document; the <code>document</code> property points to the <a href="https://developer.mozilla.org/en-US/docs/DOM/document" target="_blank">DOM document</a> loaded in that window.</span> A window for a given document can be obtained using the <a title="In browsers returns the window object associated with the document or null if none available." href="https://developer.mozilla.org/en-US/docs/Web/API/Document/defaultView" target="_blank"><code>document.defaultView</code></a> property.</li> </ol> <h2>[WHY]</h2> <ol> <li>] <a href="http://www.w3schools.com/jsref/obj_window.asp" target="_blank">Window</a> , </li> <ol> <li><strong>] properties</strong> - closed, defaultStatus, document, frames, history, innerheight, innerWidth, length, location, name, navigator, opener, outerHeight, outerWidth, pageXoffset, pageYoffset, parent, screen, </li> <li><strong>] events - </strong></li> <li><strong>] methods -</strong></li> </ol></ol> <table class="reference notranslate"> <tbody> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_alert.asp" target="_blank">alert()</a></td> <td>Displays an alert box with a message and an OK button</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_atob.asp" target="_blank">atob()</a></td> <td>Decodes a base-64 encoded string</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_blur.asp" target="_blank">blur()</a></td> <td>Removes focus from the current window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_btoa.asp" target="_blank">btoa()</a></td> <td>Encodes a string in base-64</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_clearinterval.asp" target="_blank">clearInterval()</a></td> <td>Clears a timer set with setInterval()</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_cleartimeout.asp" target="_blank">clearTimeout()</a></td> <td>Clears a timer set with setTimeout()</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_close.asp" target="_blank">close()</a></td> <td>Closes the current window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_confirm.asp" target="_blank">confirm()</a></td> <td>Displays a dialog box with a message and an OK and a Cancel button</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_createpopup.asp" target="_blank">createPopup()</a></td> <td>Creates a pop-up window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_focus.asp" target="_blank">focus()</a></td> <td>Sets focus to the current window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_moveby.asp" target="_blank">moveBy()</a></td> <td>Moves a window relative to its current position</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_moveto.asp" target="_blank">moveTo()</a></td> <td>Moves a window to the specified position</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_open.asp" target="_blank">open()</a></td> <td>Opens a new browser window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_print.asp" target="_blank">print()</a></td> <td>Prints the content of the current window</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_prompt.asp" target="_blank">prompt()</a></td> <td>Displays a dialog box that prompts the visitor for input</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_resizeby.asp" target="_blank">resizeBy()</a></td> <td>Resizes the window by the specified pixels</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_resizeto.asp" target="_blank">resizeTo()</a></td> <td>Resizes the window to the specified width and height</td> </tr> <tr> <td>scroll()</td> <td><span class="deprecated">Deprecated.</span> This method has been replaced by the <a href="http://www.w3schools.com/jsref/met_win_scrollto.asp">scrollTo()</a> method.</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_scrollby.asp" target="_blank">scrollBy()</a></td> <td>Scrolls the document by the specified number of pixels</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_scrollto.asp" target="_blank">scrollTo()</a></td> <td>Scrolls the document to the specified coordinates</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_setinterval.asp" target="_blank">setInterval()</a></td> <td>Calls a function or evaluates an expression at specified intervals (in milliseconds)</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_settimeout.asp" target="_blank">setTimeout()</a></td> <td>Calls a function or evaluates an expression after a specified number of milliseconds</td> </tr> <tr> <td><a href="http://www.w3schools.com/jsref/met_win_stop.asp" target="_blank">stop()</a></td> <td>Stops the window from loading</td> </tr> </tbody> </table> <p> </p> <h2>[WHERE]</h2> <ol> <li>]</li> </ol> <h2>[WHEN]</h2> <ol> <li>]</li> </ol> <h2>[EXAMPLE]</h2> <ol> <li>]</li> </ol> <h2>[HOW-TO]</h2> <ol> <li>]</li> </ol> <h2>[REFERENCE]</h2> <ol> <li>] <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window" target="_blank">https://developer.mozilla.org/en-US/docs/Web/API/Window</a></li> </ol>