All Downloads are FREE. Search and download functionalities are using the official Maven repository.

goog.demos.history1.html Maven / Gradle / Ivy

Go to download

The Google Closure Library is a collection of JavaScript code designed for use with the Google Closure JavaScript Compiler. This non-official distribution was prepared by the ClojureScript team at http://clojure.org/

There is a newer version: 0.0-20230227-c7c0a541
Show newest version




  goog.History
  
  
  
  



  

goog.History

This page demonstrates the goog.History object which can create new browser history entries without leaving the page. This version uses the hash portion of the URL to make the history state available to the user. These URLs can be bookmarked, edited, pasted in emails, etc., just like normal URLs. The browser's back and forward buttons will navigate between the visited history states.

Try following the hash links below, or updating the location with your own tokens. Replacing the token will update the page address without appending a new history entry.

Set #fragment
first
second
third

Set Token

The current history state:

The state should be correctly restored after you leave the page and hit the back button.

The history object can also be created so that the history state is not user-visible/modifiable. See history2.html for a demo. To see visible/modifiable history work when the goog.History code itself is loaded inside a hidden iframe, see history3.html.

Event Log




© 2015 - 2025 Weber Informatics LLC | Privacy Policy