JavaScript: elementary JavaScript tutorial (6). The Javascript tutorial uses the internal Object System of the browser to interact with HTML documents. It is used to organize and package related elements for program designers, so as to reduce the work of programmers and improve the ability to design web pages.
I. browser object hierarchy and its main functions
In addition to the document object mentioned above, the Navigator browser also provides Window objects, historical and Location objects.
Browser object (Navigator)
Provide information about browsers
Window object (Windows)
The Window object is at the top of the object hierarchy. It provides methods and properties for processing the Navigator Window.
Location)
The Location object provides methods and attributes to work with the currently opened URL. It is a static object.
Historical object (History)
The History Object provides information related to the History list.
Document Object)
A document object contains objects that work with the document elements. It encapsulates these elements for programmers to use.
With these objects, programmers can control and process the events in the WWW browser environment. JavaScript provides a wealth of internal methods and attributes, which reduces the work of programmers and improves programming efficiency. This is the fundamental difference between object-based and object-oriented. In these object systems, document objects are very important. They are located at the lowest layer, but play a key role in implementing Web page information interaction. Therefore, it is the core part of the object system.
Ii. Functions and functions of document objects
In the Navigator browser, document objects are the core and most important. See Table 6-1.
Links |
Anchor |
Form |
Method |
Prop |
Link object |
Anchor object |
Form object |
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 and anchor) for programming. From another perspective, the document Object is composed of attributes and methods.
1. Three main objects in document
In the document, there are three most important objects: links, anchor, and form:
(1) anchor object:
Anchor objects refer to objects generated when they exist in the HTML source code. It contains all the anchors information in the document.
(2) link the links object
A link object uses a tagged element that connects to a hypertext or hypermedia as a specific URL.
[1] [2] [3] [4] Next page