JS Elevation Note 8-10 Chapter

Source: Internet
Author: User
Tags tag name

8th Chapter BOM

1.window objects: Both the core object of the BOM and the global object of ES.

2. If the page contains frames, each frame has its own window object, which is saved in the Frames collection.

The 3.top object always points to the outermost frame, the browser window, which allows you to access another frame in one frame.

The parent object always points to the upper frame of the current frame.

The self object always points to window.

4.window object about the properties of the window position:

(1) Screenleft and Screentop (Firefox does not support)/screenx and screeny (ie not supported) IE refers to the document area relative to the screen distance, Chrome/firefox/safari refers to the browser window relative to the screen distance

(2) MoveTo (x, y) move to (x, y) coordinates

Moveby (x, y) moves in both the horizontal and vertical directions, respectively, and y pixels

(3) Innerwidth and Innerheight viewport width and height

Outwidth and Outheight Browser window sizes (in chrome all represent viewport sizes)

(4) Resizeto (x, y) adjusts the browser window to x width and y height

Resizeby (x, y) x, y indicates the difference between the new window and the original window

5. Navigate to a specific target or open a new window: window.open (URL, target location, attribute string, whether to replace history)

A.opener represents the original Window object that opens this window

A.closed Indicates whether the browser is closed

6. If the pop-up window is masked by the browser's built-in program, window.open () returns NULL, and if blocked by the plugin, it throws an error and must be captured with Try-catch.

7. Timeout Call: setTimeout (execution code, time). Time means how long it takes to add the current task to the task queue

Cleartimeout () Cancel Timeout call

8. Intermittent invocation: setinterval (execution code, time).

Clearinterval () cancels the intermittent call. The latter intermittent call may be started before the end of the previous intermittent call (depending on the code being executed), so it is common to simulate intermittent calls with a timeout call

9. System dialog box: Alert (), confirm (), prompt (), window.print (), Window.find ()

10.location object: Provides information about the current loaded document. is both a property of the Window object and a property of the Document object.

11.location.assign (URL): Opens a new URL, just like setting Window.location=url and Location.href=url. A record is added to the browser history and the user can go back.

Location.replace (URL): Opens a new URL, the history is not added, and the user cannot go back.

Location.reload (): Reload the current page

12.navigator objects: Providing browser-related information

13.navigator.plugins[i]: Detects if a specific plug-in is installed

Navigator.registercontenthandler () and Navigator.registerprotocolhandler ()

14. Other Objects: Screen object, History object

9th Client Detection

1. Ability Detection: (1) first detect the most common characteristics of the purpose of achieving. (2) You must test the actual features to be used. (Ensure the uniqueness indicated by the judging condition)

Detects whether an attribute will behave in the appropriate manner, rather than detecting whether it exists. P218

2. Quirks Detection: Run a small piece of code to determine that a feature is not working properly.

3. User Agent Detection: Use the user agent string to determine the actual browser used.

10th Chapter DOM

1. The document node is the root node of each document.

2.Node Type: All node types inherit from the node type, sharing basic properties and methods.

Basic properties: Nodetype,nodename,nodevalue

Node Relationship: Childnodes,parentnode,previoussibling,nextsibling,firstchild,lastchild,haschildnodes (), ownerDocument

Operation node: AppendChild (), InsertBefore (), ReplaceChild (), RemoveChild (), CloneNode (deep copy/shallow copy), normalize ()

3.Document Type: The Document object is an instance of HTMLDocument (inherited from Document type) and is also a property of the Window object.

Child nodes: The child nodes of the document node (the documentation node) may have DocumentType, Element, ProcessingInstruction, Comment.

Document.documentelement, always point to

Document.body, pointing to <body> elements

Document.doctype, get to <! References to Doctype>

Documentation Information: Document.title, document. URLs, Document.referrer, document.domain

Find information: getElementById (), Getelementbytagname (), Nameditem (), Getelementbyname (),

Special Collections: Document.anchors, Document.forms, Document.images, document.links

Conformance detection: Document.implementation.hasFeature ()

Document write: Write (), Writeln (), open (), close ()

4.Element type: Displays HTML elements, providing access to element tag names, child nodes, and attributes.

Tag name: Nodename/tagname

HTML elements are represented by HtmlElement subtypes, with attributes for each HTML element: ID, title, lang, dir, className

JS Elevation Note 8-10

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.