Gets or sets the hash string in the browser URL.
Handles getting and setting of location.hash.
| 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. |
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.
}