Reload iframe from another

Hi, I need to reload an Iframe from another. I have a blank app with 2 iframes. I need to reload left iframe from the right one that have a Menu whith a grid and when the user click the image call to another blank that add or update the table tha use on the left. I tried a lot of code but doesn’t work. I can not use a dashboard because of the menu.

<iframe  id="iframe_articu" src="../grid_pedarttemp/index.php"  class="left"  scrolling="auto" frameborder="0"></iframe>

<iframe id="iframe_selec" src="../menu_categ/index.php"   class="right"  scrolling="auto" frameborder="0"></iframe>

Thks.

Try something like this

echo "<script>
parent.iframe_articu.location.reload();
</script>";

Thank you jlboutin60 but does not work.

I tried this from the blank that I use to update de table, but I get a null value

msedge_pkSC1YdMAl

Can you give a name to your frame (like left_frame) and use the name instead of the id

echo "<script>
parent.left_frame.location.reload();
</script>";

You can also try

echo "<script>
parent.getElementById("iframe_articu").location.reload();
</script>";

or if you prefer jQuery

echo "<script>
$('#iframe_articu',parent.document).attr('src',$('#iframe_articu',parent.document).attr('src'));
</script>";

Thank you very much. I tried all that I found on internet. JS, JQuery, Ajax, but nothing works.

All getelementbyid return a null value (name or id) when I ask in the blank app that I call (open in iframe) from the grid inside the menu on the right iframe.

The problem is that they may already be inside a parent, so you may have to use

parent.parent.getElementByID

or

top.getElementByID

Genius! right answer. I have also a container. Thank you very much. I am burn out!

This works perfect

var fram=top.document.getElementById(‘iframe_articu’);
var srcant = fram.src;
fram.src=’’;
fram.src = srcant;

When I call the blank from the menu is not top anymore and does not work. I tried top.parent. but not working.

The menu should be on top, so window.document.getElementById() should work directly

Also be sure that the app is fully loaded before doing the call

Without seeing your app it’s hard to answer

1 Like

The menu call this blank

When I click the image call a blank (open in iframe) updating data and runs the script to refresh the left iframe

This is the blank that im trying to update the left iframe

Finally I got it! Thank you for your js class.

var fram=parent.parent.parent.document.getElementById(‘iframe_articu’);

can you please elaborate the solution. i have the same issue form a calendar popup. when i click on an appointment, a popup with details appear. when i use a button to go to anoter grid. the only options i got is another tab or in the popup (that never shows well). i would like to close the popup and open the new gris in the parent

Hi rotrax, the solution was using 3 parent to find the iframe to reload from the blank that i call the refresh using:

var fram=parent.parent.parent.document.getElementById(‘iframe_articu’);
var srcant = fram.src;
fram.src=’’;
fram.src = srcant;

on the last lines of the last image.

ok many thanks, i’ll take a look