iframe to parent to iframe

L

Lee

Hi, I have a page with a few iframes.

How would I write a function to refresh another iframe from one iframe?
Something like this?

function refreshOtherIframe(){
parent.document.getElementById('otherIframe').refresh();
}
 
C

Cylix

function refreshOtherIframe(){
parent.document.getElementById('otherIframe').refresh();
}

For me, I will
if (parent.frames['otherframe']) parent.frames['otherframe'].refresh();
 
L

Lee

I got this error after running this code. Any help? Thanks.

Error: parent.frames.browse_iframe.refresh is not a function

<script language="javascript">
<!--
if (parent.frames['browse_iframe']){
if(parent.frames['browse_iframe'].src=='browsechats.php'){
parent.frames['browse_iframe'].refresh(); // this is the error
}
else{
parent.frames['browse_iframe'].src='browsechats.php';
}
}
//-->
</script>

function refreshOtherIframe(){
parent.document.getElementById('otherIframe').refresh();
}

For me, I will
if (parent.frames['otherframe']) parent.frames['otherframe'].refresh();
 
C

Cylix

Lee said:
I got this error after running this code. Any help? Thanks.

Error: parent.frames.browse_iframe.refresh is not a function

<script language="javascript">
<!--
if (parent.frames['browse_iframe']){
if(parent.frames['browse_iframe'].src=='browsechats.php'){
parent.frames['browse_iframe'].refresh(); // this is the error
}
else{
parent.frames['browse_iframe'].src='browsechats.php';
}
}
//-->
</script>

Oh sorry, it should be parent.frames['browse_iframe'].location.reload();
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top