Skip to content

Instantly share code, notes, and snippets.

@thesharkjonas
thesharkjonas / Jquery Ajax
Created June 18, 2020 02:31 — forked from JonnyNineToes/Jquery Ajax
Quick template for Jquery Ajax calls
// submit is an action performed ON THE FORM ITSELF...
// probably best to give the form an ID attribute and refer to it by that
$('form').submit( function (event) {
// prevent the usual form submission behaviour; the "action" attribute of the form
event.preventDefault();
// validation goes below...
// now for the big event
$.ajax({
// the server script you want to send your data to