In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about what JavaScript commonly used built-in objects are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Browser object model
The browser object model is used to create the model of the browser window, and at the top is the window object. Here is
1 、 document
Document.getElementById / / get elements through id
Document.getElementsByTagName / / get the element through the signature
Document.referrer / / get the address of the last jump page (server environment is required)
2 、 location
_ window.location.href / / obtain or rename url address
_ window.location.search / / get the address parameter part
_ window.location.hash / / get the page anchor or hash value
3 、 history
Var HL = window.history.length
[xss_clean] (HL)
3 、 Navigator
The Navigator object contains information about the browser and is typically used to detect the version of the browser and operating system.
Var browser=navigator.appName
Var b_version=navigator.appVersion
[xss_clean] ("Browser name" + browser)
[xss_clean] ("
")
[xss_clean] ("Browser version" + b_version)
4 、 screen
The screen object is used to get the screen information of the user.
II. Document object model
DOM is the abbreviation of document object Model (Document Object Model). DOM uses a tree structure to represent the hierarchy of HTML documents. In the whole DOM standard, the core interface is Node, which corresponds to all nodes in the DOM tree, and all types of node interfaces are inherited from the Node interface.
Interface Node: {many properties and methods}
Interface Document: Node {many properties and methods}
Interface HTMLDocument: Document {many properties and methods}
Interface Element: Node {many properties and methods}
Interface HTMLElement: Element {many properties and methods}
3. Global JavaScript object
The name of a global JavaScript object is usually capitalized.
1. String: dealing with strings
2. Number: dealing with numbers
3. Boolean; handles Boolean values
4. Date: processing date
5. Math: calculate and process numbers
6. REgEx: string pattern that matches the text
Thank you for reading! This is the end of this article on "what are the common built-in objects in JavaScript?". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.