How to pass URL query values to another page?

Hello coders, newbie here!

I have a site that has, lets say two pages:
1 Welcome ( )
2 Auth ( )

On the Welcome page, the user gets an option to select whether to Sign Up or Log In to the site. When the user chooses Sign Up , the mode is set to signup and if the user clicks on Log In the mode is set to login.

Now I want to pass this data to the Auth page via the URL for example:

I know the simplest way to do this would be this:

var mode = login;"/auth?mode=" + mode);

And this is working well.

However I’d like to use the QueryParams add() to achieve the same.

var mode = login;

  "mode": mode

And that’s working too… kinda. But here’s the catch. It adds the query parameters to the current page URL ( which is completely useless in this case.

So how do I use QueryParams add() along with to achieve the following URL:

(I’m sure there must be a very simple solution to this but me being a beginner can’t figure it out on my own!)


P.S. I’m not using wix-storage-frontend here because my website will have to communicate with external apps in the future so the only way to pass data from the would be through the URL using key - value pairs.


Using is the correct way to pass query parameters when navigating between pages.

Since queryParams.add() can only be used once the page is loaded, it does not work for this use case.

Is there some functionality you would like that () does not allow you to accomplish?

Thanks for the info!

Currently I’m using ( ) and manually adding the queries to the URL instead of using queryParams.add() so it works for now. Thanks! (: