Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | History | Q1034 [ previous next ]

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

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.