Gets or sets the hash string in the browser URL.
Handles getting and setting of location.hash.
(hash,replace);
Parameter | Type | Description |
---|---|---|
hash | String | Optional
the hash is set - #string. |
replace | Boolean | Optional
If true, updates the hash value in the current history state instead of creating a new history state. |
Returns: any | undefined
when used as a getter, returns the current hash string. when used as a setter, returns the new hash string.
See the dojo/hash reference documentation for more information.
topic.subscribe("/dojo/hashchange", context, callback);
function callback (hashValue){
// do something based on the hash value.
}
© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/hash.html