Javascript used to create random pages to open with a click.
I was approached by some friends that wanted to make a site that generated random messages with a click.
The trick was that they wanted to be able to share the messages on social media.
So I had to create server-side messages to get specific urls that they could share.
It took me some time to figure out how to make it work and wanted to share it with people.
The uploaded html is pretty straightforward. The onclick method is used to call the function. The function is in the script below the body. The function creates a random number from 1-4 and those numbers are used to call the random pages.
Enjoy.
If there are ways to make it better, please share. Thank you.