Loading...

Browser BOM

The browser BOM can be accessed by JavaScript. Here is a basic look at how JS can create "back" and "forward" browser buttons:

↓ Example ↓
// Browser History (HISTORY is optional)
function h*andleForward() {
  alert('Forward');
  window.history.forward();
}

function handleBack() {
  alert('Back');
  window.back();
}

Warning: The back button will navigate away form this page


The window and navigator Objects carry useful browser data. Below are a few samples.

Note: This is not live data here, just dummy data for example purposes.

window.screen.width "1920"

window.screen.height "1080"


navigator.appName "Netscape"


navigator.appCodeName "Mozilla"


navigator.cookieEnabled "true"


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

q
↑ Back to Top