Js-window Object Collection

Source: Internet
Author: User

<! DOCTYPE html>


<meta charset= "UTF-8" >
<title>window Object Collection--Net summary </title>
<style type= "Text/css" >
td{
border:1px solid #4169E1;
}
caption{
Background-color:lightsteelblue;
padding:10px 0;
}
table{
margin-top:10px;
border:4px solid lightsteelblue;
}
</style>

<body>
<table>
<caption>window Object Methods </caption>
<tr>
<td> Methods </td>
<td> Description </td>
</tr>
<tr>
<td>alert () </td>
<td> displays a warning box with a piece of information/code snippet and a confirmation button </td>
<td> is typically used for code debugging </td>
</tr>
<tr>
<td>prompt (' Hint info ', ' default input information ') </td>
<td> Displays a dialog box to prompt the user for input </td>
</tr>
<tr>
<td>confirm (' hint text ') </td>
<td> displays a dialog box with a message and a confirmation button and a Cancel button </td>
</tr>
<tr>
<td>open ([url], ' _blank ', ' properties ') </td>
<td> Open a new browser window or find a named window </td>
<td> properties include: width,height, whether there are scroll bars, menu bar, ... </td>
</tr>
<tr>
<td>close () </td>
<td> Close the browser window </td>
</tr>
<tr>
<td>print () </td>
<td> Print the contents of the current window </td>
</tr>
<tr>
<td>focus () </td>
<td> give keyboard focus to a window </td>
</tr>
<tr>
<td>blur () </td>
<td> Leave the keyboard focus from the top-level window </td>
</tr>
<tr>
<td>moveby () </td>
<td> The current coordinates of the window can be moved to move the specified pixel </td>
</tr>
<tr>
<td>moveto () </td>
<td> Move the upper-left corner of the window to a specified coordinate </td>
</tr>
<tr>
<td>resizeby () </td>
<td> Resize the window by the specified pixels </td>
</tr>
<tr>
<td>resizeto () </td>
<td> Adjust the size of the window to the specified width and height </td>
</tr>
<tr>
<td>scrollby () </td>
<td> Scrolls content by the specified pixel value </td>
</tr>
<tr>
<td>scrollto () </td>
<td> Scrolls content to the specified coordinates </td>
</tr>
<tr>
<td>setinterval (' Code ', Time (ms)) </td>
<td> execute code for each specified time </td>
<td> Cycle Timers </td>
</tr>
<tr>
<td>clearinterval (timer name) </td>
<td> Cancel settings for setinterval </td>
</tr>
<tr>
<td>settimeout (' Code ', deferred execution time) </td>
<td> execute code after the delay time has been established </td>
<td> One timer </td>
</tr>
<tr>
<td>cleartimeout (timer name) </td>
<td> Cancel settings for settimeout </td>
</tr>
</table>

<p>setinterval (A, b);
A can be a function name, or it can be a function body. Function names can be called in parentheses, or they can be called without parentheses. Parentheses are called in quotation marks.
as follows:
setinterval (hanshu,1000);
setinterval (' Hanshu () ', +);
</p>
common objects in the
<ol>
<li>history Object
<ul><li> Prerequisites: Must have historical records </li>
<li>history.back () Back to previous page </li>
<li>history.forward () Back to next page </li>
<li>history.go (number) returns a page in the specified history
<ol>
<li>history.go (1) ==history.forward () </li>
<li>history.go (0) = = Current Page </li>
<li>history.go ( -1) ==history.back () </li>
<li>history.go (3) return to the third history page that you browsed after the current page of the browser </li>
<li>history.go (-2) = = Returns the second penultimate page viewed before the current page </li>
</ol>
</li>

</ul></li>
<li>location Object </li>
<li>navigator Object </li>
</ol>

<table>
<caption>location Object Properties </caption>
<tbody>
<tr>
<td> Properties </td>
<td> Description </td>
</tr>
</tbody>
<tr>
<td>hash</td>
<td> Sets or returns the URL (anchor) starting with # </td>
</tr>
<tr>
<td>host</td>
<td> set or return the host name or port number of the current URL </td>
</tr>
<tr>
<td>hostname</td>
<td> Sets or returns the host name of the current URL </td>
</tr>
<tr>
<td>href</td>
<td> Set or return the full url</td>
</tr>
<tr>
<td>pathname</td>
<td> Sets or returns the path portion of the current URL </td>
</tr>
<tr>
<td>port</td>
<td> Sets or returns the port number of the current URL </td>
</tr>
<tr>
<td>protocol</td>
<td> Sets or returns the protocol for the current URL </td>
</tr>
<tr>
<td>search</td>
<td> set or return from Hello (? ) Start URL (query section) </td>
</tr>
</table>
<table>
methods of <caption>location </caption>
<tbody>
<tr>
<td> Properties </td>
<td> Description </td>
</tr>
</tbody>
<tr>
<td>assign () </td>
<td> Loading new documents </td>
</tr>
<tr>
<td>reload () </td>
<td> Reload Current document </td>
</tr>
<tr>
<td>replace () </td>
<td> Replace the current document with a new document </td>
</tr>
</table>

<table>
<caption>navigator. Properties </caption>
<tbody>
<tr>
<td> Properties </td>
<td> Description </td>
</tr>
<tr>
<td>appCodeName</td>
<td> string representation of the browser code name </td>
</tr>
<tr>
<td>appName</td>
<td> return browser name </td>
</tr>
<tr>
<td>appVersion</td>
<td> return to the browser's platform and version information </td>
</tr>
<tr>
<td>platform</td>
<td> return to the operating system platform running the browser </td>
</tr>
<tr>
<td>userAgent</td>
<td> Returns the value of the user-agent header of the server sent by the client </td>
</tr>
</tbody>
</table>
</body>

Js-window Object Collection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.