NS_Binding_Aborted error for ajax function

来源:互联网 发布:同城约爱用什么软件 编辑:程序博客网 时间:2024/05/18 05:31

坑。。。。。。。。。。。。。。
在提交的时候,发现,ajax提交的请求无法请求到Spring MVC里面去!!!奇怪了。但是,在请求的JavaScript函数当中,如果用一个alert弹出页面,即可请求到服务器去。于是乎,抓包发现,ajax的post请求的状态为NS_Binding_Aborted。经过网上的查证,发现是还没有响应这个ajax的时候,这个页面被刷新了。

This is caused by another request that abort your request. Generally
when your goal is reload data o all page just end request and don’ts
is synchronized request, a little novell error. In this case the
“return ” sentence is the problem, the return sentence must be in
success seccion.

后来才发现,原来form表单中,不能使用button这个标签,而是要用input标签,type=“button”,这样不会刷新页面,于是每次都可以请求成功了。

0 0
原创粉丝点击