1 /* Get from elements values */
2 var values = $(this).serialize();
3
4 $.ajax({
5 url: "test.php",
6 type: "post",
7 data: values ,
8 success: function (response) {
9
10 // You will get response from your PHP page (what you echo or print)
11 },
12 error: function(jqXHR, textStatus, errorThrown) {
13 console.log(textStatus, errorThrown);
14 }
15 });
16
1 $.ajax({
2
3 url : "file.php",
4 method : "POST",
5
6 data: {
7 //key : value
8 action : action ,
9 key_1 : value_key_1,
10 key_2 : value_key_2
11 }
12 })
13
14 .fail(function() { return false; })
15 // Appel OK
16 .done(function(data) {
17
18 console.log(data);
19
20 });