Home  >  Article  >  Web Front-end  >  关于jQueryMobile表单提交Servlet问题_html/css_WEB-ITnose

关于jQueryMobile表单提交Servlet问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:03:321449browse

前台用的是jQueryMobile的一个form表单,然后提交到Servlet进行处理,servlet里面response的重定向用不了,手机上点击提交后页面就显示errorpage提示文字,经过查询说是要将ajax禁用,我在form标签里加了 data-ajax="false"后,提交后服务器就报异常了。

不加data-ajax="false"  提交的内容可以存到数据库,就是页面不跳转,加了后提交的数据连数据库都存不了,我不知道加了data-ajax="false" 后Servlet里面是否要做修改,求指点,感激不尽!


回复讨论(解决方案)

那就用ajax就好了,我怎么这么笨,自己给解决了。。

	    $(document).ready(function () {			$("#submitbtn").click(function(){					cache: false,					$.ajax({					  type: "POST",					  url: "feedback",					  data: $('#feedbackform').serialize(),					  success:function(data){					  		$.mobile.changePage("success.html");					  }			  	});			});        });

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn