A little utility CoffeeScript for setting and getting query parameters more conveniently.
You can create a new Gurli instance using myGurli = new Gurli()
. This object will represent your current location with your current query parameters. You can then call the following methods on the object:
Adds the a new pair to the Gurli object. If the key already exists, the value is overridden.
Returns the value for the specified key. Returns undefined if no value is associated.
Removes the specified key (if present) from the Gurli object.
Removes any query parameters from the Gurli object.
Replaces the part of the url before the question mark, but retains query parameters.
Returns a URL encoded string that contains the full URL with the set query parameters.
Navigates to the URL specified in the Gurli object.