Recently I was submitting a form using AJAX.
In researching the best method I saw some AJAX submissions using jQuery#serialize()
and others using FormData
. For example.
One submission did this:
data: $('form').serialize()
while the other did:
var formData = new FormData($('form')[0]);
data: formData
So what is the difference between FormData
and jQuery#serialize()
?