dojo/hash (version 1.10)

Summary

Gets or sets the hash string in the browser URL.

Handles getting and setting of location.hash.

Usage

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.

Examples

Example 1

topic.subscribe("/dojo/hashchange", context, callback);

function callback (hashValue){
    // do something based on the hash value.
}

Method Summary

Methods

Error in the documentation? Can’t find what you are looking for? Let us know!