Button to load page from dataset

Hi, here is the situation:

I have a dataset of different URLs with different items, called ‘test’. I also have a script, that goes through the dataset as an array and randomly (intentionally) loads one of the pages from the dataset. Now what i am strugling with is assigning a button to run the script on click. Because i don’t want to link it with any particular page, the button doesn’t actually act like button, but more like an image of a button, if that makes sense.

So how can i have a button that loads a page from a dataset though a onClick function in a script?

Thanks!

Hi Jonas,

Sounds like a job for the location.to command.

Hi anthonyb,

Thank You for the answer. i am using this function as well, but the button is still not clickable. Please check the detailed issue here (2nd point).

https://www.wix.com/code/home/forum/community-discussion/working-with-arrays