Net#updateQueryString()

updateQueryString(key, value, redirect, url) → {string}

Updates a value on the Query String and returns it in full.
If the value doesn't already exist it is set.
If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string.
Optionally you can redirect to the new url, or just return it as a string.

Parameters
Name Type Description
key string

The querystring key to update.

value string

The new value to be set. If it already exists it will be replaced.

redirect boolean

If true the browser will issue a redirect to the url with the new querystring.

url string

The URL to modify. If none is given it uses window.location.href.

Returns
string -

If redirect is false then the modified url and query string is returned.

Source code: net/Net.js (Line 52)
doc_phaser
2017-02-14 10:55:37
Comments
Leave a Comment

Please login to continue.