Fork me on GitHub

url.js

A lightweight JavaScript library to manipulate the page url.

Download .zip Download .tar.gz View on GitHub

Add a new parameter

Url.updateSearchParam("foo", "bar")

Update the foo parameter

Url.updateSearchParam("foo", "42")

Delete the foo parameter

Url.updateSearchParam("foo")

Get the foo value

alert(Url.queryString("foo"))

Parse the current url search

alert(JSON.stringify(Url.parseQuery()))

Stringify an object

alert(Url.stringify({bar: 42, foo: "bar"}))

Url.getLocation()


                    
Check out the documentation on GitHub.