What attributes and methods of document and window are used in jQuery

Source: Internet
Author: User

Document. activeElement

Get the element that gets the focus of the document.

Document. head

The following document. head | document. getElementsByTagName ("head") [0] is used in jQuery: not all browsers support this function.

Document. body

Obtain the HTMLBodyElement of the current document.

Document. compatMode

Obtain the rendering method of the current document. Returned values: BackCompat (odd mode) and CSS1Compat (standard mode ).

As Internet Explorer supports up to five batch models, the so-called batch mode is a strange pattern. It facilitates the unique document.doc umentMode of Internet Explorer for additional detection.

See this article http://www.jb51.net/article/21717.htm

Document. readySate

Returned file loading status: uninitialized, loading, loaded, interactive, and complete all browsers support this attribute (FF3.6 or above ).

In a standard browser, common HTML elements do not have this attribute (except for the script tag of Opera ).

The ready function in jQuery uses the complete status value to determine whether the DOM tree is fully loaded.

Document.doc umentElement

Returns the document root element (HTMLHtmlElement)

Document.doc umentElement. currentStyle

Unique IE Method to get element styles

Document.doc umentElement. contains ()

Dedicated to IE, used to determine whether a document contains a specified node Element

Document.doc umentElement. compareDocumentPosition ()

This method is supported by comparing the current node with the specified node's document location IE9.

See http://www.jb51.net/article/28281.htm for details

Document.doc umentElement. doScroll ()

The unique method of IE is used to simulate clicking on the user's scroll bar. jQuery uses this method to check whether the DOM tree is available in ie6.

Non-IE can use obj. scrollTop + = 10; applicable elements include html, body, div, span, textarea, etc.

For more information, see http://msdn.microsoft.com/en-us/library/ms536414 (VS.85). aspx

Document. defaultView (DOMWindow)

Returns the window object associated with the current document or null. IE 9 supports this attribute.

Document. defaultView. getComputedStyle ()

Obtain the element style information (non-inline) and return the style table object. W3C standard method; IE corresponds to the currentStyle attribute

Window. frameElement

Obtains the iframe element of the host node of the current document.

Window. location

Returns the URL of the current document.

Window.exe cScript ()

The execScript function and eval function have the same functions. The difference is that the scope of the script after eval function execution is the current execution context, while execScript always applies to the global scope.

In IE, the eval and window. eval functions are the same. The script scope executed by window. eval is also the current execution context.

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.