Dom manipulation of JavaScript (2)

Source: Internet
Author: User

Add:

Carriage return character \ r and line break \ n the difference:\ r equals Enter, which is the difference between a paragraph and a paragraph,

\ n equals Shift+enter, is the distance between rows and rows, smaller than

several window Operation Method:

1. Get the current window size and print:

var height=window.innerheight;var width = window.innerwidth;
document.write ("<br/>" + "height" +height+ ", width" +width);

2. Open the window, close the current window

window.open ("http://baidu.com");
Window.close ();

3. Move the current window to a location (x, y)

Window.moveto (200,200);

4. Change the size of the current window (width,height)

Window.resizeto (1100,1100);

5. Get the current page address

document.write (LOCATION.HREF);

6, "History" page forward (forward to the previous history, equivalent to "→"), back (back to the previous history, equivalent to "←")

<!--backwards use the. Back method setting in another Web page to--><input type= "button" onclick= "A ()" value = "point me forward"/>
function A ()
{
Window.history.forward ()/* Go ahead to the previous history */
}

*navigator Visitor's browser information

Alert: Warning Box confirm: Confirmation box prompt: Prompt box

Basic syntax: Data type (string, Decimal, Integer, Boolean, time) Var,
var s = "3.14"; var n = parsefloat (s);; s + = 5;
var d = parseint (s);
IsNaN (String): A string that determines if it is a digital shape;-false; not-true.

Operators: Four categories
An expression:
Statements: three major classes (sequential, branching, looping)
Branch: if () {}; If...else ...; If...else if...else If ... else;if nested
Cycle: exhaustive, iterative; four elements (initial conditions, cyclic conditions, loop bodies, state changes):
Array; var a = new Array ()
Functions: Four elements (name, input, return, processing)
function Show ()
{
}

Second, Dom operation: Tree
Window Object--browser windows

Window.location: Address bar
Window.history: Access History
Window.status: Status bar
Window.document: Focus!

Dom manipulation of JavaScript (2)

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.