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

Q591 How do you reload a page in frame 2 from frame 1?

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

Q591 How do you reload a page in frame 2 from frame 1?

Try something like:

<A HREF="javascript:parent.framename.location.reload()">Reload</A>

where framename is the name of frame 2.

Alternatively, you can use the frame index number (1st frame is 0, 2nd frame is 1..., nth frame is n-1), combined with a simple test to see if the browser supports the locaton objects reload() method:

<script language="JavaScript"><!--
function reloadFrame(number) {
    if (document.images)
        parent.frames[number-1].location.reload();
    else
        parent.frames[number-1].location.href = parent.frames[number-1].location.href
}
//--></script> 

<a href="javascript:reloadFrame(2)">Reload</a>

Feedback on 'Q591 How do you reload a page in frame 2 from frame 1?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


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