JavaScript BOM CheatSheet

JavaScript BOM CheatSheet

Download
Download is available until [expire_date]
  • Version
  • Download 13
  • File Size 1.16 MB
  • File Count 1
  • Create Date March 30, 2023
  • Last Updated March 30, 2023

Exploring the Hidden Gems of BOM in JavaScript: Features and Methods You Need to Know

As a web developer, you are probably familiar with JavaScript and its many features for manipulating the Document Object Model (DOM). But have you heard of the Browser Object Model (BOM)?
BOM is a set of APIs that allow JavaScript to interact with the browser itself, rather than just the document being displayed. This includes things like the window object, which represents the current browser window, and the history object, which tracks the user's navigation history.
One key aspect of BOM is its ability to control browser behavior, such as opening and closing windows or tabs, resizing, and moving windows, and displaying dialogs and alerts. This makes it a powerful tool for creating interactive web applications.

Features:

  • Window object: Represents the browser window and provides access to its properties and methods.
  • Navigator object: Provides information about the user's browser and system.
  • History object: Tracks the user's navigation history.
  • Screen object: Provides information about the user's screen size and resolution.
  • Location object: Provides information about the current URL and allows navigation to other URLs.

Methods:

  • open(): Opens a new browser window or tab.
  • close(): Closes the current browser window.
  • resizeTo(): Resizes the current browser window to a specified size.
  • moveTo(): Moves the current browser window to a specified position.
  • alert(): Displays an alert message to the user.
  • prompt(): Displays a prompt message to the user and returns their input.
  • confirm(): Displays a confirmation message to the user and returns their choice.
  • back(): Navigates the user back to the previous page in their navigation history
  • forward(): Navigates the user forward to the next page in their navigation history.
  • href = 'url': Navigates the user to a new URL.

Overall, JavaScript BOM is a powerful and versatile tool for web developers and understanding its features and capabilities can help you create more dynamic and interactive web applications. So, if you have not explored BOM yet, now is a great time to start!

Spread the word:

Leave a Reply