Comment puis-je actualiser seulement un div en succès au lieu d'actualiser la page entière en utilisant Ajax?Actualiser un div en cas de succès au lieu d'actualiser la page entière en utilisant Ajax?
$('a.add-to-cart').click(function (e) {
var url = "<?php echo createItemLink($row['id']);?>";
e.preventDefault();
$.ajax({
type: 'post',
url: "<?php echo SITEURL;?>/ajax/addtoCart.php",
data: 'itemid=<?php echo $row['id'];?>&price=<?php echo $row['price'];?>&name=<?php echo $row['title'];?>',
success: function (msg) {
$("#status").fadeIn(300).delay(800).fadeOut(300).ajaxComplete(function (event, request, settings) {
$(this).html(msg);
$(location).attr('href',url);
});
}
});
});
On dirait que vous l'avez résolu! Vous êtes génial merci! – JonnyPlow