HomeArticlesFAQsXREFGamesSoftwareInstantBooksBBSAboutFOLDOCRFCsFeedbackSearchSite-Map
logo

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>

©2011 Martin Webb