The History Object
You there, Tippy!
We're slowly getting to the bottom of this script. Now we'll get into the history statement right at the end and wrap it up. Here's the script so you can familiarize yourself again:
Notice in this script that not only is the browser being told to go somewhere within the history file, it is being told to go somewhere specific. In this case it is to go one back. See that (-1)?
And That's That
- You log into the page and the script is loaded into the browser.
- The function is enacted upon the loading of the page.
- A confirm box pops up with text written on it.
- If the person chooses OK, the script is done and the page loads.
- If the person chooses Cancel, then the history.go is enacted and the browser goes one page back or reloads the page the user just came from.
Next Time: A New Script! Browser Choice