-
Notifications
You must be signed in to change notification settings - Fork 0
queryStringHandler updateParameter
Mike Byrne edited this page Jan 25, 2022
·
2 revisions
Updates a specified key's value in a query string
- nothing
- url - required - URL to update
- key - required - key to update, if the key doesn't exist, it gets added
- value - required - value to update, can handle ''
- new URL string with updated parameter
var initialURL = 'http://a17-js-helpers.com?foo=bar&baz=qux';
var newURL = queryStringHandler.updateParameter(initialURL, 'baz', 'bar'); // returns http://a17-js-helpers.com?foo=bar&baz=qux