关于jsp中使用history.go(-1);js不刷新的问题
来源:互联网 发布:做淘宝亏钱 编辑:程序博客网 时间:2024/05/21 22:46
jsp使用:
js脚本:
//表单提交保存function submitForm() {$.ajax({type : "post",url : "${ctx}/safety/.../updateSafeEduTrainSave.do",dataType : "json",data : $("#form").serialize(),success : function(msg) {if(msg == true){alert("更新成功");history.go(-1);}else{alert("更新失败");}}});}html的form表单:
<form id="form" enctype="multipart/form-data" method="POST" >/*form表单的内容*/</form>错误提示:
解决:
问题出在提交方式(Get/Post)上,如果使用Post提交,history.go(-1)返回会出现网页已过期的错误
实现页面跳转:表单提交时如果要使用history.go();方法的话建议表单提交方式用get方式提交表单、或者是超链接(默认是get提交方式)
表单提交时如果要使用post方式提交的话请不要使用history.go()方法,使用重定向即可(location.href = ""; ),或ajax重新请求
另外还要注意浏览器的兼容问题
阅读全文
0 0
- 关于jsp中使用history.go(-1);js不刷新的问题
- js中history.go(-1)
- window.history.go(-1);window.history.back(); 在谷歌浏览器不兼容的问题
- window.history.go(-1)返回上页的同时刷新
- window.history.go(-1)返回上页的同时刷新
- javascript history.go(-1) 返回刷新
- 关于history.back()后,页面刷新的问题
- 关于history.back()后,页面刷新的问题
- asp.net关于history.go问题
- js history.go 使用浏览器缓存
- 关于ios的wap页面window.history.go(-1)
- android Webview中注入js,用于解决第三方页中出现返回事件window.history.go(-1),无法响应问题
- javascript的history.go(-1)
- 关于在JSP中使用<img>不显示文件的问题
- window.history.go(-1)返回上页的同时刷新"上页"技术
- window.history.go(-1)返回上页的同时刷新"上页"技术
- window.history.go(-1)返回上页的同时刷新"上页"技术
- window.history.go(-1)返回上页的同时刷新"上页"技术
- FlowLayout实现自定义的流式布局
- 顺序栈使用——括号匹配的检验
- spring整合JNDI和Tomcat
- C++ cout输出字符
- Centos6.5修改镜像为国内的阿里云源
- 关于jsp中使用history.go(-1);js不刷新的问题
- J1939入门(一)
- c++ prime plus 第4章 复习题回顾
- springboot整合mybatis(xml版)
- 原生JS设计轮播图
- 小谈Java数据结构
- WPF、MVVM和Prism学习历程
- 理解over()开窗函数
- PHP+Redis 操作