Skip to content
Update JQuery authored by Joel H's avatar Joel H
......@@ -134,7 +134,7 @@ $.ajax('data/item.json', {
```javascript
//ajax POST
let id = $(this).parent().data('id'); //from data-id attribute
$.ajax('data/addToCart.json', {
$.ajax('data/addToCart.json', { //ici, addToCart.json sert seulement à renvoyer une reponse. Dans la "vraie vie", on utilise un link d'un backend qui fait son traitement derrière pour qu'il enregistre la donnée et renvoie une réponse ensuite.
type: 'post',
data: { id: id}, //these are the things that we send to the server
dataType: 'json',
......
......