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 work.
This plugin extends jQuery's built-in method. If jQuery UI is not loaded, calling the .hashchange()
method may not fail directly, as the method still exists. However, the expected behavior will not occur.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
|
iFrame source: example1.html