Post form by AJAX and jQuery


/ Published in: jQuery
Save to your folder(s)

This code shows how we post HTML form by AJAX and jQuery.


Copy this code and paste it in your HTML
  1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
  2. <script>
  3. $(document).ready(function () {
  4. $("#Form1").submit(function (Event) {
  5. Event.preventDefault()
  6. $.post(
  7. "Insert.php",
  8. $(this).serialize(),
  9. function (Data) {
  10. // Success
  11. }
  12. )
  13. })
  14. })
  15. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.