A lightweight JavaScript library to manipulate the page url.
Browse the demos on http://jillix.github.io/url.js/
<script src="path/to/url.js"></script>
<script>
Url.updateSearchParam("answer", 42);
</script>
Finds the value of parameter passed in first argument.
- String
name
: The parameter name. - Boolean
notDecoded
: Iftrue
, the result will be encoded.
- String The parameter value.
Parses a string as querystring.
- String
search
: An optional string that should be parsed (default:window.location.search
).
- Object The parsed querystring.
Stringifies a query object.
- Object
queryObj
: The object that should be stringified.
- String The stringified value of
queryObj
object.
Adds, updates or deletes a parameter (without page refresh).
- String
param
: The parameter name. - String
value
: The parameter value. Ifundefined
, the parameter will be removed.
- Url The
Url
object.
Returns the page url, but not including the domain name.
- String The page url (without domain).
- File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
- Fork the project in your account and create a new branch:
your-great-feature
. - Commit your changes in that branch.
- Open a pull request, and reference the initial issue in the pull request message.
See the LICENSE file.