Refreshing one iframe from another?

K

Kim Noer

Hi there..

I have a file that contains three iframes, when one of the iframes is
updated (via <form target ...> then it must 'refresh/reload' the originating
iframe, ie. the iframe that sent the form action.

I've looked around, but I haven't managed to find a method yet, that does
not utilitize some MS only method. So how do I do it, and maintaining W3C
compatibility?
 
M

Martin Honnen

Kim Noer wrote:

I have a file that contains three iframes, when one of the iframes is
updated (via <form target ...> then it must 'refresh/reload' the originating
iframe, ie. the iframe that sent the form action.

I've looked around, but I haven't managed to find a method yet, that does
not utilitize some MS only method. So how do I do it, and maintaining W3C
compatibility?

Not W3C but if you use
<iframe name="iframe1" ...
and
<iframe name="iframe2"
then you can script
if (parent.frames.iframe2) {
parent.frames.iframe2.location.reload();
}
that is more compatible with existing browsers than relying on W3C DOM
stuff where you need
<iframe id="iframe1" ...
and
<iframe id="iframe2"
with script
if (parent.document.getElementById) {
var iframe2 = parent.document.getElementById('iframe2');
if (iframe2 && iframe2.defaultView) {
iframe2.defaultView.location.reload();
}
}
 
K

Kim Noer

Not W3C but if you use (...)
that is more compatible with existing browsers than relying on W3C DOM

Thanks a bunch, this one worked without any problem (both in IE and
Firefox).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top