From cad76e33178dbf858010859646e10916a5b3b0ad Mon Sep 17 00:00:00 2001 From: Divlo Date: Fri, 4 Oct 2019 23:53:26 +0200 Subject: [PATCH] Optimized DOM Manipulation --- scripts/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/main.js b/scripts/main.js index 76b6a09..ca37fe3 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -143,9 +143,11 @@ $(function () { /* Permet d'afficher la liste des citations/proverbes */ if(chemin === "/views/quote-list.php") { window.onload = $('.totalLengthQuote').html('Total de ' + quotes.length + ' citations.'); + let resultat = ""; for (index in quotes) { - $( ".quote-list" ).append(' ' + quotes[index]["source"] + ' " ' + quotes[index]["quote"] + ' " '); + resultat = resultat + ` ${quotes[index]["source"]} ${quotes[index]["quote"]} `; } + $( ".quote-list" ).append(resultat); } $("#submitConvertCurrency").click(function()