jsp页面刷新方法

jsp页面刷新方法jsp 页面处理完数据自动刷新 window location reload jsp 页面处理完数据自动刷新并返回上二级界面 top Dialog close 原文地址 https blog csdn net liuweidong article details Javascript 刷新页面的几种方法 1 history go 0

jsp页面处理完数据 自动刷新 window.location.reload();

jsp页面处理完数据 自动刷新并返回上二级界面 top.Dialog.close();

原文地址:https://blog.csdn.net/liuweidong_/article/details/

测试效果一样。表单没有提交。



都提交数据

最好不要用location.reload(),而用location=location比较好,还有在模式窗口(showModalDialog和showModelessDialog)前者不能用。

reload参数有true和false,比较有意思?

—————————————————————————–

window.history.go(0);

window.location.assign(window.location.href)

1.html -> 2.html -> 3.html

系统从1.html到2.html后,2中有两个按钮,btn1是window.location.href=3.html, btn2是window.location.replace(3.html), 当点击btn1后在3中用window.history.go(-1);window.history.back();返回的是1.html,

而点击btn2进入3时,用window.history.go(-1);wondow.history.back();返回的是2.html

——————————————————–

window.location.href和window.location.replace的亲身体验与区别

当用window.location.href是使用window.history.go(-1)或window.history.back()是管用的

当用window.location.replace(‘url’)是使用window.history.go(-1)或window.history.back()是不管用的

window.location.replace(“3.jsp”);是不向服务器发送请求的跳转

window.history.go(-1);window.history.back();方法是根据服务器记录的请求决定该跳到哪个页面的

window.location.href(“3.jsp”);是向服务器发送请求的跳转,window.history.go(-1);wondow.history.back();方法是根据服务器记录的请求决定该跳到哪个页面的

——————————————————–


  

 

  

 

  

 

  

 








在C# Web程序中,如为页面按钮写返回上一页代码

this.RegisterClientScriptBlock(“E”, ““);

其中,history.go(-2),要写为-2,因在按钮事件触发前,已刷新一次页面,所以应是-2。

Response.Write(““);

 

原文地址: http://blog.csdn.net/weifeib/article/details/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/222742.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午3:04
下一篇 2026年3月17日 下午3:05


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号