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

Q529 How I can restrict the history of a window to one location?

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

Use:

<script language="JavaScript"><!--
function go(url) {
    if (document.images)
        location.replace(url);
    else
        location.href = url;
}
//--></script>

<a href="default.html" onClick="this.href='javascript:go(\'http://www.somewhere.com/default.html\')'">just go there</a>

Note: in Opera replace() will work, but only with absolute URL's.

©2018 Martin Webb