Pages

Tuesday, November 27, 2012

Jquery ajax request send json object after binding from a form

This is a common mistakes done by jquery developers. Say you have a form (with form tags) and you extract the form data and create a json object and send it to a url via ajax. Also lets say your action is also the ajax url. Then if you send the content via jquery ajax, pre-request callback will append the form content to the jason object you extracted. So in order to avoid this you can set return to false in the form.

No comments:

Post a Comment