Return to Kroll Design home page

JavaScript Tutorials

 
« Return

history object

The history object stores locations of prior web pages visited.

Code:

<script type="text/javascript">
//<![CDATA[
document.write("history.length is the number of pages currently in history: " + history.length + "<br /><br />");
document.write("<a href='#' onclick='javascript:history.back()'>history.back()</a> is the same as clicking the back button.<br /><br />");
document.write("<a href='#' onclick='javascript:history.forward()'>history.forward()</a> is the same as clicking the forward button.<br /><br />");
//]]>
</script>

Output:



 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM