Yesterday, when I was making a form to submit content asynchronously, I encountered a very strange problem. The submit() method could not be submitted. Every time I submitted, the current was refreshed. The network packet capture was discovered. Every time I found the current page, and there was no post request at all. I thought that I encountered such problems before because the name or id in the form conflicted with submit. However, after checking several times, no name conflicts were found, so this possibility was excluded.
I usually do my own trigger buttons and basically don’t use the a tag. But yesterday I didn’t know what the problem was, so I actually used a and gave href empty. Since there are multiple contents in this class, I didn’t look at href and didn’t write content when checking. Therefore, every time you perform a click operation, the href="" operation will be triggered, and this operation will reopen the current page, so submit cannot function. Solution: add javascript:; or javascript:void(0);
Where the problem occurs:
Solved:
js part:
The quick solution to the above article on js and jq cannot submit forms using submit method is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.