1,reload 方法,该方法强迫浏览器刷新当前页面。
语法:location.reload([bForceGet])
参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前页。true, 则以 GET 方式,从服务端取最新的页面, 相当于客户端点击 F5(“刷新”)
window.location.reload();//方法1
document.getElementById(‘FrameID’).contentWindow.location.reload(true);
//方法2
document.getElementById(‘youriframe’).src=src;
实例:
id="myframe" src="test.html" scrolling="no" width="100%">二。jquery实现强制刷新
('#iframe').attr('src',(‘#iframe’).attr(‘src’));
//刷新包含该框架的页面用
parent.location.reload();//子窗口刷新父窗口
self.opener.location.reload();( 或 刷新 )
//刷新另一个框架的页面用