Reputation: 1223
I have a site with a frame:
<frameset cols="69%,31%">
<frame src="main.php" />
<frame src="result.html" />
</frameset>
Its looks like this:
------------|-----------
|
search | result1
| result2
| result3
|
|
|
|
------------|---------
Here is how it workrs (it is much more complex)
Main.php (left frame) uses a search (like a search engine) result.html (right frame) , only reads what main.php founds, so:
What I want to do is refresh result.html from main.php. How can I do this???
NOTE: I do not want to autorefresh result.html (right frame) with AJAX timer or something. The refresh must be triggered by main.php (left frame)
Upvotes: 0
Views: 12277
Reputation: 13797
It's simple.
first, you need to assign "name" attribute in your frame like:
<frameset cols="69%,31%">
<frame src="main.php" />
<frame src="result.html" /> </frameset>
In main.php
<script> function btn_reset() { parent.result.location.reload(); } </script>
<input type="button" value="Click" onclick="btn_reset()">
Upvotes: 1
Reputation: 10072
If you add a JavaScript function into the page that holds the two frames you can accomplish this.
In the parent page:
refreshResults = function () {
resultFrame.location.reload();
}
and then call it from main.php like this:
parent.refreshResults ();
Upvotes: 2