In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.