Freshman said:
I have two php scripts running and iframes the result from both of
them on one html-page. This page is then iframed into my website...
The resource that your iframe includes is only relevant if its URI has
another protocol, port or host part. In that case what you want to do
cannot be done in a default browser environment for security reasons
(Same Origin Policy, SOP).
I need the option to reload the two original iframes. I have tried to
add this into the header of the page with the two iframed results:
The HEAD element is _not_ the header (cf. RFCs 1945 and 2616). There is no
page, there is an (X)HTML _document_.
<script type="text/javascript">
OK.
<!--
Remove this, it is unnecessary and potentially harmful.
As David said. But do not simply lowercase this because then you might
overwrite an existing method. Name it differently, starting lowercase
(e.g. `iframeReload').
var f = document.getElementById('iFrame',iFrame2');
You have a syntax error here; any error console would have shown it: The
*ignored* second argument is either not a proper identifier (that is what
the script engine would complain about) or not properly delimited (if we
assume that you wanted a string value instead); remove it.
If you want to reload two iframes at a time, either use a loop over an
array of string values, or two assignments.
This may or may not reload the iframe. Better use one of these (in order
of increasing compatibility and, unfortunately, standards-compliance):
window.frames["iFrame"].location.reload();
f.contentWindow.location.reload();
f.contentDocument.defaultView.location.reload();
For the first one you might need to give the iframe a name (i.e. `name'
attribute) in order to be backwards-compatible.
Remove this.
</script>
And this button to call the script:
<form><input type="button" value="Reload" onclick="Reload();"></form>
You do not want the form because your FORM element is not Valid (the
required `action' attribute is missing).
You do not need the form because the INPUT element can stand alone, and you
do not submit anything here.
You want to generate that INPUT element dynamically (e.g. with
`document.write') so that it does not confuse users with browsers without
scripting capability (where clicking would not have any effect).
But it doesnt reload anything. My two iframed results are given id
iFrame and iFrame2.
BAD -- borken as designed, see above. You should also use better,
preferably lowercase IDs.
Please read the FAQ before posting here again:
<
http://jibbering.com/faq/#posting>
PointedEars