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')

posted @ 2017-06-07 10:11  淡紫色鍀薰衣草  阅读(343)  评论(0编辑  收藏  举报