Linking Internal page URL

Hi wix Team ,

I am trying to link a interanla web page dynamically through a code .

i mean

 if( condition1)
 Page_link_1 open; 
else if( condition2)
Page_link_2 open;

how to link webpages from a code .
help required

Thanks
Jap

Hi,
You can use the wix-location.to API for that:

In the docs you can read on how to navigate to an internal page, anchor, external page and more.