Jump to content

Reload Iframe From Different Window (Not Child) - Javascript


Recommended Posts

Hello All!


I am trying to figure out how to refresh an iframe from a popup window.


I can do it when the popup is called from the main page (ADDing records), but I can't figure it out for a popup that is called from within the iframe (EDITing records).


In addition to residing within an iframe the button to call the EDIT popup is a Caspio Data Page and is built from javascript during page load.


Please consider the following scenario. (I removed classes, titles, and other irrelevant items for simplicity)


Main Page:



<div id="vehicles">
<div class="frmHeader">
<h2>Vehicles</h2>
<a onclick="popupWindow('addVehicle.html')"></a><!-- ADD vehicle -->
<a onclick="ifrRefresh('ifrVehicle')"></a>
</div>
<iframe src="lic/vehicle.html" name="ifrVehicle" id="ifrVehicle"></iframe>
</div>

Iframe Content html file:



<div id="ifrContentVehicle" class="ifrContent killHeader">
<script src="/scripts/e1.js"></script>
<script>try{f_cbload("***","http:");}catch(v_e){;}</script>
</div>

Iframe Content after load:



<div id="ifrContentVehicle" class="ifrContent killHeader">
<form id="caspioform">
<div>
<table name="cbTable">
<tbody>
<tr>
<td>
<a onclick="popupWindow('editVehicle.html?VehicleID=*')"></a><!--EDITv-->
...

Add Vehicle:



<script>
window.onunload = refreshParent;
function refreshParent() {
window.opener.ifrVehicle.location.reload();
}
</script>

This works to refresh my iframe named ifrVehicle. However, I cannot get it to work with the Edit popup.


Any help will be greatly appreciated!


CHAD


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...