1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
$("#id1").submit(function(e){
e.preventDefault();
$(document).ajaxStart(function() {
$("#reponse1").css({ 'color': "black" });
$('#reponse1').text('Transaction en cours ...');});
var donnees = $(this).serialize();
$.ajax({
type: "POST",
url: "ajax_guide.php",
data: donnees,
dataType: "text",
success: function(data) {$("#reponse1").css({ 'color': "red" });$('#reponse1').text(data);},
error: function() {$("#reponse1").css({ 'color': "red" });$('#reponse1').text('Une erreur est survenue');}
});
});
$("#nomform").submit(function(e){
e.preventDefault();
$(document).ajaxStart(function() {
$("#cible").css({ 'color': "black" });
$('#cible').text('Transaction en cours ...');});
var donnees = $(this).serialize();
$.ajax({
type: "POST",
url: "ajax_article.php",
data: donnees,
dataType: "text",
success: function(data) {$("#cible").css({ 'color': "red" });$('#cible').text(data);},
error: function() {$("#cible").css({ 'color': "red" });$('#cible').text('Une erreur est survenue');}
});
}); |
Partager