I need help with what I think is actually very simple. I want a piece of code to generate a random number which then becomes the input to select a dynamic page in wix.
Ultimately I want to show my clients a QR code which will take them to the Wix page which has the random number generator code in it and then they are immediately takes them to the page associated with the number. I'd want to be able to change the code to change input the minimum and maximum number if i add or take away more items in the database
Ive created a database in Wix with all the information that would populate the dynamic page and have an Integer as the index so that part works fine.
Im struggling with Corvid code (Im not a coder). I have managed to cobble together some simple code and publish it from GitHub, but I'd love to get it inside my own Wix website.
Below is what I have done at GitHub and this works and does exactly what I want (maybe it's not the most elegant piece of coding ever!) - so essentially I am asking - how can i do the same inside a Wix page?
// generate a random number between 1 and 20 and then go to the dynamic page with that number reference
code = Math.floor(Math.random() * 20) + 1;
window.location.href = 'https://www.mywebsite.com/disclose-and-discover/'+code;
All ideas gratefully received