Use of JavaScript Object systems

Source: Internet
Author: User

Using the browser's internal object system enables you to interact with HTML documents. Its role is to package the relevant elements, provided to the program designers to use, thereby reducing the labor of programmers, improve the ability to design Web pages.

I. Browser object hierarchy and its main role

The Navigator browser also provides window objects as well as historical (History) and location (Location) objects, in addition to the documents document objects mentioned earlier.

Browser object (Navigator)

Provide information about your browser

Window objects (Windows)

The Window object is at the top of the object hierarchy, which provides methods and properties for handling Navigator windows.

Location Object (Location)

The Location object provides methods and properties that work with the currently open URL, which is a static object.

Historical Objects (History)

The History object provides information about the history list.

Documents object (document)

The Document object contains objects that work with the documentation element (elements), which encapsulates these elements for use by programmers.

Programmers can use these objects to control and handle events in the WWW browser environment. Provides a wealth of internal methods and properties in JavaScript, which eases the programmer's work and improves programming efficiency. This is precisely the fundamental difference between objects and object-oriented objects. In these object systems, the document object is very important, it is at the lowest level, but it plays a key role in our implementation of Web page information interaction. Thus it is the core part of the object system.

Second, Document object function and its function

In the Navigator browser, the document documentation object is the core and the most important. See table 6-1 for the following.

Links Anchor Form Method Prop
Linked objects Anchor Object Form objects Method Object

Table 6-1 Document Object

As can be seen from table 6-1, the main function of the document object is to package these basic elements (such as links,anchor, etc.) for use by programmers. From another perspective, the document object is made up of attributes and methods.

1. Three main objects in document

There are three most important objects in the document: Links,anchor,form and so on:

(1) Anchor anchored object:

The Anchor object refers to an object that is produced when the <a name=...> </A> identity exists in the HTML source code. It contains all the anchors information in the document.

(2) Link links object

A link object refers to a hypertext or hypermedia-connected element with a <a href=...> </A> tag as a specific URL.

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.