JavaScript - Browser

The JavaScript Browser Object Model (BOM) represents the objects exposed by the web browser.

History

The history object represents the browsers URL history. Methods are back(), forward() and go().

// go back twice
history.go(-2);

Location

The location object represents the document URL.

// reload the current document
location.reload();

// current location properties

Navigator

The navigator object contains several properties with info about the browser.

// information about the browser
navigator.userAgent;

// current navigator.userAgent properties

Screen

The screen object contains properties with info about the display.

// show information about screen size
alert(screen.width + 'x' + screen.height);

// current screen properties
Loading Disqus Comments ...
Loading Facebook Comments ...