I have a page that sets a few variables using javascript Math.random() as shown.
var RandomValue1 = Math.floor(Math.random() * 5);
var RandomValue2 = Math.floor(Math.random() * 6);
var string = array1[RandomValue1];
var string = array2[RandomValue2];
I would like to allow a user to pass the RandomValue value through the URL to another person. When the second person goes to the shared URL, RandomValue is the value as the first person - so that the second person sees the same 'string' as the first person.
I am fairly new to web design and web programming so I don't know if this needs to be handled on the server-side or client-side.
I assume I need to pass a url something like page1.html?RandomValue1=1&RandomValue2=3 but I cannot get the page to then set those variables and load. Can this be done in JavaScript?