Uniform Resource Locator Plugin for the Sandbox API
Eric Bréchemier © 2011, Some Rights Reserved Legal-Box SAS © 2010-2011, All Rights Reserved
BSD License http://creativecommons.org/licenses/BSD/
2011-08-14
lb. | Uniform Resource Locator Plugin for the Sandbox API |
Functions | |
url(sandbox) | Define methods in the ‘url’ property of given sandbox. |
sandbox. | Get the properties of the current URL location |
sandbox. | Jump to a new local location by replacing the hash part of the URL. |
sandbox. | Set a listener to observe changes in local part of the URL. |
Get the properties of the current URL location
an object with a copy of properties commonly found on window.location and document.location:
Jump to a new local location by replacing the hash part of the URL.
This method is used for local navigation, and ensures, in collaboration with the cross-browser history adapter module, that the back button of the browser works as expected.
hash | string, the new local location, e.g. ‘#local/path’ |
Set a listener to observe changes in local part of the URL. Calling this method with a new callback will replace the listener previously set. Calling onHashChange(null) will remove the current listener altogether.
callback | function, the callback(hash) function will be called once for each subsequent change of hash. The hash parameter is a string, decoded, starting with the ‘#’ character. |