add( )


Adds query parameters to the current page's URL.

Adds one or more query parameters to the current page's URL.

The add() method can only be used when browser rendering happens, meaning you can only use it in frontend code after the page is ready.

If a specified key already exists as a query parameter, the newly specified value overwrites the key's previous value.

Calling the add() method triggers onChange() if it has been registered.

Note: To retrieve the page's current query parameters, use the query method.

Method Declaration
Copy
Method Parameters
toAddToAddRequired

An object containing a key

pair for each query parameter to add to the URL, where the object's keys are the query parameter keys and the object's values are the corresponding query parameter values.

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?