Client-Side JavaScript
Learn about DOM, BOM, and variety of scriptable web APIs.
Client-Side JavaScript, Browser environment
The JavaScript language was initially created for web browsers. Since then it has evolved and become a language with many uses and platforms.
A platform may be a browser, or a web-server or another host, even a “smart” coffee machine, if it can run JavaScript. Each of them provides platform-specific functionality. The JavaScript specification calls that a host environment.
A host environment provides own objects and functions additional to the language core. Web browsers give a means to control web pages. Node.js provides server-side features, and so on.
Here’s a bird’s-eye view of what we have when JavaScript runs in a web browser:
- Root Object ( Global Object )
- window
- DOM ( Document Object Model )
- document
- BOM ( Browser Object Model )
- navigator
- screen
- location
- frames
- history
- XMLHttpRequest
- …and many more.
What is browser Web APIs?
A variety of scriptable objects that represent web browser windows, documents, document content, and various features of the browser.
- console - to output something to the console
- fetch() - fetch api for fetching resources
There are over hundreds of APIs is work in progress. The main two groups working on these APIs are WHATWG and W3C. Visit their website to get latest information about next hot new API they are working on currently.
Also, visit https://developer.mozilla.org/en-US/docs/Web/API to find the list of all the APIs that are available.
Tree of DOM node classes
The one at the bottom inherit properties and methods from the top.
- EventTarget
- Node
- CharacterData
- Comment
- Text
- Document
- Element
- SVGElement
- HTMLElement
- HTMLAnchorElement
- HTMLInputElement
- HTMLTableElement
- …and many more
- CharacterData
- Node
Further reading
References
Written by Saabbir Hossain
Sr. Software Engineer at EchoLogyx Ltd, CRO-driven Shopify Plus Developer and Optimizely Certified A/B Testing Expert based in Bangladesh.
Discussion & Comments