jquery刷新iframe页面的方法

一:js/jquery中刷新iframe方法(兼容主流)

方法一:
console.log($(window.parent.document).find("#FrameID").attr("src")); //获取当前页面的iframe的url $(window.parent.document).find("#FrameID").attr("src",url); //设置iframe的url
方法二:
document.getElementById('FrameID').contentWindow.location.reload(true);

二:实现强制刷新

$('#FrameID').attr('src', $('#FrameID').attr('src'));

 三、

在iframe中操作body下的DOM节点~ document.getElementById('iframeID').contentWindow.document.getElementById('元素的ID')

原文地址:https://www.cnblogs.com/zsy0712/p/6955606.html