.post简化.ajax方式提交form表单

来源:互联网 发布:xp 在端口23连接失败 编辑:程序博客网 时间:2024/04/27 21:22
<pre name="code" class="html"><script type="text/javascript">$("#submit").click(function(){$.post("${pageContext.request.contextPath}/news/addImportantNews", $("#formData").serialize(),function(data){alert(data.flag);}, "json");//${pageContext.request.contextPath}/news/addImportantNews"为请求action的路径//formData为表单id//data为后台返回值});</script>


                                             
0 0
原创粉丝点击