From ed41184b6190d1204a35ff691e345cdcf26b9a3a Mon Sep 17 00:00:00 2001 From: salimkhr Date: Fri, 16 Feb 2024 11:18:25 +0100 Subject: [PATCH] Optimize car card rendering process on index.js Changed the car card rendering process from directly appending to innerHTML to using a string variable for concatenation. This change provides performance benefits by limiting direct DOM manipulation. Additionally, a new "category" field has been added to the car card. --- README.md | 9 +++++---- index.html | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f6c70af..e004fb2 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,11 @@ Résumé du sujet : Vous devrez réaliser un site de e-commerce proposant des voitures. ## Partie A : Utilisation des prototypes -**Créer un prototype Extra dans le fichier js/extra.js, contenant les propriétés suivantes : +Créer un prototype Extra dans le fichier js/extra.js, contenant les propriétés suivantes : + +- `name` +- `price` -name -price Créer un prototype Car dans le fichier js/car.js contenant les propriétés suivantes : - `image` @@ -75,7 +76,7 @@ Ces 2 méthodes doivent ajouter l'élément créé à celui passé en paramètre completer la fonction `showHideExtra` de maniére a : 1. afficher `+` sur le boutton si les extras sont masqué et `-` sinon -1. afficher ou masquer la liste des extras en utilisant `car.generateExtras()` +1. afficher ou masquer la liste des extras en utilisant les fonctions du prototype Car Département Informatique BUT Info 2 - 2023/2024 diff --git a/index.html b/index.html index 4637e47..be6da78 100644 --- a/index.html +++ b/index.html @@ -36,10 +36,8 @@