Forum Moderators: coopster
Basically, I am trying to refresh a PHP based file/image (in the iFRAME) in a PHP file. Can someome point me in the direction of a tutorial that includes this topic (I failed to find one), or suggest an approach I might follow? Thanks for reading this.
To do this manually, there are a couple of ways.. but I think you'd probably be looking at something javascript-based instead. My javascript is a little rusty since I don't use it often...
If you put a button in the iframe that you want to click to refresh it, then try window.location.reload() (among many other possibilities). If you put the button outside of the iframe, then you'll have to reference the frame by name. This may be top.[iframe-name].location.reload().
"Object doesn't support this property or method"
My test code:
<html>
<head>PHP in HTML
</head>
<body>
<h2><font face="arial" color="green"></font></h2><br><br>
<Iframe name=my_iframe
src="test_file.php" width="300" height="300">
</Iframe>
<form>
<input type="button" value="Reload" onClick="my_iframe.window.reload()">
<input type="button" value="Reload" href="#" onclick="window.frames['my_iframe'].reload(true)">
</form>
</body>
</html>
I must be overlooking something. Any ideas? Thanks.
<input type="button" value="Reset code" onClick="my_iframe.location.reload()">
Thanks for your patience and help. I think I can live without a reload button within the iframe box.