Search...
queryParams
Gets an object used to manage the query segment of the current page's URL.
Type:
QueryParamsRead Only
Was this helpful?
Add query parameters to the URL
Code Example
1import wixLocation from 'wix-location';23// ...45wixLocation.queryParams.add({6 "key2": "value2new",7 "key3": "value3"8});910// URL before addition:11// www.mysite.com/page?key1=value1&key2=value21213// URL will look like:14// www.mysite.com/page?key1=value1&key2=value2new&key3=value3
Remove query parameters from the URL
Code Example
1import wixLocation from 'wix-location';23// ...45wixLocation.queryParams.remove(["key1"]);67// URL before removal:8// www.mysite.com/page?key1=value1&key2=value2910// URL after removal:11// www.mysite.com/page?key2=value2