JavaScript Browser object Model BOM (Browserobjectmodel) example detailed _javascript tips

Source: Internet
Author: User
Tags arrays

This example describes the JavaScript browser object model BOM. Share to everyone for your reference, specific as follows:

The Window object is at the top level of the BOM hierarchy. It contains a number of very important child objects, including Location,navigator,document,screen,history. The Location object contains the URL information for the current page. Some of the information is read-only, and some information can be read and written, such as the href attribute. Not only can we get the URL information for the current page through the href attribute, but we can also jump to the new page by modifying the href attribute.

 
 

The history object holds the history of the page visited by the user since the browser was opened. However, some pages are not recorded, such as pages loaded using the Location object's replace () method will not be recorded in the History object.
The Navigator object represents the browser itself, which contains some very useful information about the browser, such as the version number, the browser type, and the operating system the user is using.
The Screen object contains information about the display capabilities of the customer service side.

 
 

Document is one of the most important objects. The Document object contains three array properties links[],images[],forms[]. These three arrays represent all the collections of objects created by <A>, , <form>, respectively, on the page.

  
 
  
 
 
 

With these three arrays, you can access the corresponding object created for the tag, modify the image of the page by modifying the properties of the IMG object, and change the URL of the hyperlink by modifying the properties of the Hyperlink object.

More readers interested in JavaScript-related content can view the site topics: "JavaScript Operation DOM Skills Summary", "JavaScript replacement Operation Tips Summary", "JavaScript Value manipulation Skills Summary", " JavaScript Coding Operation Tips Summary, "JavaScript in the JSON Operation tips Summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills Summary", "JavaScript animation effects and Skills summary", " JavaScript error and debugging skills Summary, JavaScript data structure and algorithm skills summary, JavaScript traversal algorithm and skills summary and JavaScript mathematical calculation usage Summary

I hope this article will help you with JavaScript programming.

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.