hashchange event

hashchange

hashchange eventversion added: 1.0

Description: Enables bookmarkable #hash history.

  • jQuery( ".selector" ).on( "hashchange", function( event ) { ... } )

The jQuery Mobile .hashchange() event handler enables very basic bookmarkable #hash history by providing a callback function bound to the window.onhashchange event. The onhashchange event fires when a window's hash changes.

In browsers that support it, the native HTML5 window.onhashchange event is used. In IE6/7 (and IE8 operating in "IE7 compatibility" mode), a hidden iframe is created to allow the back button and hash-based history to wo