The script shown below occurs in the head of this HTML document. It should cause an alert window to open and then, after the user clicks the OK button, load the last page visited before this one. The body of this page, will NOT appear before the script is run by the broswer. The actual code has been "commented out" so that it doesn't work. You should view the source of this document. Delete the comment markers around the JavaScript commands in the head. Save a copy, and then load the saved copy into a browser (that has "gone" several other places first, if you want to see what history.go(-1) does), to see the script in action.

<script type="text/javascript" language="JavaScript">
    alert("An alert is called in the head, is the document empty? Prepare to go back a page!")
    history.go(-1)
</script>