If you reload this page, you will see a different message. The script on this page holds five different messages. One possibility is to display a random message from the list. However, the user will most likely see some of the messages more than once before seeing them all. Thus, the best solution is to keep track of the last message via cookies.
Nothing is as easy as it looks.
If the cookie isn't found, we initialize the variable message by assigning it 0. The script simply loops through the array of messages by keeping track of the last message's index. For more information about cookies, refer to Column 8, Crispy JavaScript Cookies . Nothing is as easy as it looks. All Rights Reserved.