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

Q582 Is there a way to change the location of another frame to an anchor within that frame regardless of what document is loaded into that frame?

You are here: irt.org | FAQ | JavaScript | Frame | Q582 [ previous next ]

As long as its a page from the same server as the JavaScript code then yes:

<script language="JavaScript"><!--
function go(frame,anchor) {
    frame.location.href = frame.location.protocol + '//' + frame.location.host + frame.location.pathname + '#' + anchor;
}
//--></script>

<form>
<input type="button" onClick="go(parent.otherFrameName,'anchorName')" value="Jump">
</form>

Feedback on 'Q582 Is there a way to change the location of another frame to an anchor within that frame regardless of what document is loaded into that frame?'

©2018 Martin Webb