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
