I have a wrapperPage.html
with an <iframe class="header"
and <iframe class="pageBody"
. In header
there is a link, <a class="clearLink"
, which when clicked should clear the contents of pageBody
.
So far the following implementation of the above idea doesn't work. Please help me resolve this.
Please NOTE that, header
and pageBody
are each loaded from different included files.
wrapperPage.html
<div class=non-floater>
<iframe class="header" src="header.html"></iframe>
<iframe class="pageBody" src="pageBody.html" />
</div>
header.html :
<script type="text/javascript">
$(document).ready(function() {
$(".clearLink").on("click", function() {
$('.pageBody').contents().find("body").html('');
});
});
</script>
<a class="clearLink" href="#">Navigation Button</a>
pageBody.html :
<div class="panel-body">This is the body</div>
Try using Channel messaging
wrapperPage.html
header.html
You can get the reference of the main window from an iFrame as follow: Window.Parent reference
Then, you can assign an event to catch a trigger or a function in the main window (or only in the other iFrame) to manage it.
For example :
header.html
iFrame.I would hope it help you.