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

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

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

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">

©2018 Martin Webb