如何從另一個iFrame中清除iFrame的內(nèi)容我wrapperPage.html和一個<iframe class="header"和<iframe class="pageBody"。在header有一個鏈接,<a class="clearLink"點(diǎn)擊時應(yīng)該清除內(nèi)容pageBody。到目前為止,上述想法的以下實(shí)現(xiàn)不起作用。請幫我解決這個問題。請注意,header并且pageBody每個都從不同的包含文件加載。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>
如何從另一個iFrame中清除iFrame的內(nèi)容
明月笑刀無情
2019-08-23 10:26:18