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

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?

irt.org | Knowledge Base | JavaScript | Frame | Q582 [ previous next ]

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?

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?'


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.