Tsallaka zuwa abun ciki
Justice Tech School

Project: AJAX Form

Submit a form without reloading.

Example
$("#f").on("submit", function (e) {
  e.preventDefault();
  $.post("/save", $(this).serialize()).done(function () {
    $("#msg").text("Saved");
  });
});

Exercise

Send form data.

$.post(url, $(this).())

Quiz Test

What does preventDefault avoid?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.