AJAX POST 后跳转页面Form submission canceled because the form is not connected的问题解决

在使用AJAX进行POST提交时遇到'Form submission canceled because the form is not connected'错误。参考HTML标准和StackOverflow上的解答,通过在document.body中添加form解决了问题。错误源于如果表单未关联到浏览上下文,提交会被取消。解决方案是在AJAX请求前将form添加到document.body。
摘要由CSDN通过智能技术生成


参考了这篇文章:https://segmentfault.com/q/1010000000473230 后报错误:Getting Error “Form submission canceled because the form is not connected”
 

然后在:http://stackoverflow.com/questions/42053775/getting-error-form-submission-canceled-because-the-form-is-not-connected 找到了答案,增加了 $(document.body).append(form);后问题解决。


具体原理如下:


Details : According to the HTML standards, if the form is not associated browsing context(document), form submission will be aborted.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值