用window.location.href实现刷新另个框架页面
来源:互联网 发布:淘宝钱包 编辑:程序博客网 时间:2024/05/29 07:28
在写ASP.Net程序的时候,我们经常遇到跳转页面的问题,我们经常使用Response.Redirect ,如果客户要在跳转的时
候使用提示,这个就不灵光了,如:
Response.Write("<script>alert('恭喜您,注册成功!');</script>");
Response.Redirect("main.html");
这时候我们的提示内容没有出来就跳转了,和Response.Redirect("main.html");没有任何区别。
这时我们采用下面代码试验一下:
Response.Write("<script language=javascript>alert('恭喜您,注册成功!')</script>");
Response.Write("<script language=javascript>window.location.href='main.html'</script>");
这个即实现了我们的要求,在提示后,跳转页面。
最重要的是window.location.href 语句可以实现一个框架的页面在执行服务器端代码后刷新另一个框架的页面
(Response.Redirect无法达到,至少我没有发现):
如:index.htm页面中有二个框架,分别为 frameLeft和frameRight,在frameRight页面中执行服务器端代码后刷新
frameLeft中的页面。
先前最常见的是注册之后,自动刷新登陆框,让登陆框换成已登陆页面,只要在注册成功的代码之后加上一段,即可以
实现刷新另个框架的页面。代码如下:
Response.Write("<script language=javascript>alert('恭喜您,注册成功!')</script>");
Response.Write("<script
language=javascript>window.parent.frameLeft.location.href='main.html'</script>");
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现刷新另个框架页面
- window.location.href刷新页面
- 用window.location.href实现页面跳转
- 用window.location.href实现页面跳转
- 用window.location.href实现页面跳转
- window.location.href = window.location.href刷新页面的问题
- 论window.location.href = window.location.href刷新页面的问题
- window.location.href = window.location.href刷新页面的问题
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location href、parent location href、top location href、window open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- .net 导出库推荐
- Memory Management Links
- java笔试题总结与大家分享
- Ibatis在mysql中获得主键与连接池技术合并的又一问题
- 软件架构师应该知道的97件事
- 用window.location.href实现刷新另个框架页面
- 了解jQuery技巧来提高你的代码
- 猪圈里的跟随策略(博弈论的诡计)
- 继续。。。
- 下一代Android或官方支持“App2sd”
- Linux下配置Java环境及Tomcat安装(图文)
- 谷歌3830万美元投资美风力发电站
- 在Ubuntu里安装 Dropbox客户端图文详解
- 重生序