我有一个不断刷新自己的页面,我想将该页面包含在我的主页中。
我使用iframe将页面包含到我的主页中,但每次iframe中的页面刷新时,它也会刷新我的主页。如何才能使iframe在其自身框架内刷新,而不影响我的主页?
或者,有没有更好的方法来包含页面而不使用iframe?
发布于 2010-10-21 19:51:33
document.frames["myInnerFrame"].location.href=fl;
http://www.hotscripts.com/forums/javascript/15955-javascript-command-refresh-iframe-content.html
发布于 2011-07-20 11:57:22
如果您需要从asp.net代码后台页面刷新父页面,则只需注册客户端脚本即可在页面加载时运行:
protected void btnOk_Click(object sender, EventArgs e)
{
//Implement Your logic here.....
//..............................
//now refresh parent page and close this window
string script = "this.window.opener.location=this.window.opener.location;this.window.close();";
if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);
}
关于How to refresh parent page on child window close的逐步教程演示了上述函数的用法。
发布于 2014-03-16 22:29:06
https://stackoverflow.com/questions/3991226
复制相似问题