todo: 按钮提交导致cancled的一个例子

发布于 2024-11-13 19:13:19

jq使用ajax请求,返回状态 canceled错误
在使用jq,ajax请求时出现该错误

输入图片说明

原因:button按钮类型为type=submit ,script中又自定用botton按钮点击提交ajax,造成冲突。
解决方法:button按钮类型改为 type=button

<button id="save" class="btn btn-primary btn-sm">${text('保存')}</button>
改为
<button id="save" type=button class="btn btn-primary btn-sm">${text('保存')}</button>

0 条评论

发布
问题