Is it possible to intercept a form's POST string and send it via AJAX instead? I could use $('form').submit() to intercept the POST event, but I don't see where I can get the POST string from. I could reproduce the string from the form's inputs, but this seems dubious.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
use
.serialize()
, it will ncode a set of form elements as a string for submission.Note that as Phil stated in his comment that
.serialize()
doesn't include the submit button. If you also need to value of the submit buton you would have to add it manually.You can do of course - you prevent your form from submitting as usual, you take its data and perform a
POST
via jQuery: