Closed marnusw closed 13 years ago
What is set for? I didn't notice that it was added. Why is this needed? Thanks.
It is possible to set the url with an object using attrs()
or by assigning a string to window.location.hash
, but I wanted to be able to use either without worry and therefore I introduced set()
. It takes an object or string as parameter and changes the url appropriately.
I use it for specific redirects such as going to the home page for which I specify the url string; this means I don't have to worry about what the route variables are. It also means you never have to use window.location.hash
directly. Other than that I suppose the method is not that big a gain.
Changed a remaining case of
window.location.hash
tolocation.hash
according to earlier clean-up..set() returns $.route for a fluent interface.
Caught myself passing a hash string to .set() with the '#!' included even though it gets added by the method. Figured this might easily happen so I added a check for it; now works for '!', '#!' or without prefix.