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

Q404 Is there a way that a button can be kept from reloading a frame again until the frame is reloaded?

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

Q404 Is there a way that a button can be kept from reloading a frame again until the frame is reloaded?

If you own all the pages - then yes:

<head>
<script language="JavaScript"><!--
var loaded_it_yet = true;
//--></script>
</head>

<frameset rows="50%,*">
<frame src="mainpage.htm">
<frame src="otherframe.htm">
</frameset>

and then in mainpage:

<script language="JavaScript"><!--
function check_first() {
    if (parent.loaded_it_yet) {
        parent.frames[1].location.href = parent.frames[1].location.href;
        parent.loaded_it_yet = true;
    }
}
//--></script>

<form>
<input type="button" value="Reload" onClick="check_first()">
</form>

and then in otherframe.htm:

<body onLoad="parent.loaded_it_yet = true">

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.