[1].html页面代码

<a href="javascript:;" title="刷新当前页" id="Refresh" style=" position: relative; display: inline-block; vertical-align: middle; margin-right: 15px; margin-top: 4px;">
<i class="iconfont" style=" font-size: 30px; color: #009688;"> &#xe6ae;</i>
</a>

[2].实现的js

//刷新iframe 绑定
$("#Refresh").bind("click", function () {
$('#my_iframe').attr('src', $('#my_iframe').attr('src'));
});

2.子页面刷新父页面的iframe

parent.document.getElementById('my_iframe').contentWindow.location.reload(true);

3.停两秒刷新

var int=self.setInterval(function(){ // 这个方法是说在延迟两秒后执行大括号里的方法
parent.document.getElementById('my_iframe').contentWindow.location.reload(true)
// 这个方法是刷新当前页面
},2000);

 

相关文章:

  • 2021-09-16
  • 2021-11-03
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-29
  • 2021-07-17
猜你喜欢
  • 2021-05-11
  • 2022-12-23
  • 2022-02-10
  • 2021-12-04
  • 2021-12-15
  • 2022-12-23
相关资源
相似解决方案