Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1034 Is there a way to always set the location to the first entry in the history object?

You are here: irt.org | FAQ | JavaScript | History | Q1034 [ previous next ]

You can tell how many entries there are in the history object by the value of its length property. You can use this to access any entry within the history object:

<SCRIPT LANGUAGE="JavaScript"><!--
function absolute(x) {
    history.go(x-history.length);
}

absolute(1); // go to first entry
//--></SCRIPT>

©2018 Martin Webb