JavaScript Document Object

Source: Internet
Author: User

The 1.document object is a child of the Window object, can be used directly, and is used to get HTML page elements

2.document Object Properties

A) Alinkcolor activity link Color

b) LinkColor text link color

c) Vlinkcolor user has observed the text color of a document link

d) Cookie information stored on the client by the cookie

①. Some small text files that some Web sites store users ' information on their hard drives

②.cookie can record user's user name, password, page visited, time of stay, etc., so as to facilitate the user's operation again.

The information in ③.cookie is stored as a "key-value" pair, and its information can only be a character in the URL encoding, if there is a Chinese need to convert Chinese characters, that is, the cookie stored in the client can only be a number and letter information

④. If you want to delete a cookie, you can modify its date to expire automatically.

3.document Object Methods

A) Clear the specified document content--not recommended

①.docobj.clear ()--no parameters, no return value

②. Closing the document flow and then opening the document flow the document content is automatically cleared

b) Close the document flow

①.docobj.close ()--no parameters, no return value

②. The method is automatically executed when the page has finished loading

③. When the Write () method is called to dynamically generate a page, the system waits until the close () method is not

④. When you add an OnLoad event to a window, the OnLoad event is not triggered when the close () method is not called

c) Open Document flow

①.docobj.open ([arg])--arg represents the MIME type of the output stream, default text/html; no return value

d) write text to document

①.docobj.write (HTMLSTR)

②. The output stream needs to be closed using close () after the output is finished, otherwise the output will be appended when the write () method is called again

e) Write text to document and wrap

①.docobj.writeln (str)

JavaScript Document Object

Related Article

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.