加载iframe后重新加载iframe

Dmi*_*kin 3 html javascript iframe jquery

每次满载时我都需要重新加载(回收)iframe

我试着用javascript做这件事

    <iframe id="iframe_your_bids" src="../file.asp">
    </iframe>

    <script> 
    $(document).ready(function() {
    document.getElementById('iframe_your_bids').contentWindow.location.reload();
    });
    </script>
Run Code Online (Sandbox Code Playgroud)

但是iframe没有重装

如何在每次完全加载时重新加载iframe?

Ale*_* T. 6

你可以使用这样的.load事件

$(document).ready(function() {
  $('#iframe_your_bids').load(function(){
    document.getElementById('iframe_your_bids').contentDocument.location.reload(true);
  });
});
Run Code Online (Sandbox Code Playgroud)
<iframe id="iframe_your_bids" src="../file.asp"></iframe>
Run Code Online (Sandbox Code Playgroud)