Some websites, such as Facebook games, incorporate step-by-step tutorials for new users using JavaScript to display pop-ups guiding the user on where to click next and explaining what is happening.
How can one develop a similar system? What type of architecture is necessary?
It appears that a script is activated when a tutorial flag is set, and within the user's state, there is a 'pointer' indicating the current step in the tutorial. This script would generate the appropriate JavaScript for pop-ups, highlighting, and other features.
The main question is how to determine when the user has completed the required action and is ready to move on to the next step of the tutorial.
Edit: The 'action required to proceed to the next step' could involve clicking on a link or submitting a form field. Therefore, the user's state must persist, and the script needs to be able to detect interactions on various UI elements across the page.