参考了这篇文章: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.