1$('#myForm')
2 .ajaxForm({
3 url : 'myscript.php', // or whatever
4 dataType : 'json',
5 success : function (response) {
6 alert("The server says: " + response);
7 }
8 })
9;
10
1$('#form').submit(function(){
2 $.ajax({
3 url: $('#form').attr('action'),
4 type: 'POST',
5 data : $('#form').serialize(),
6 success: function(){
7 console.log('form submitted.');
8 }
9 });
10 return false;
11});
12