From: Nicolas Braud-Santoni <nicolas@braud-santoni.eu> Date: Thu, 7 Dec 2017 15:31:29 +0000 (+0100) Subject: templates: Chargement quasi-asynchrone du script de navbar X-Git-Url: https://www.nos-oignons.net/gitweb/website.git/commitdiff_plain/1ff8060debd9623580281f6cb75be71616cfbf7d templates: Chargement quasi-asynchrone du script de navbar Utiliser `async` serait plus efficace, mais demanderait de modifier le script (il y aurait une « race condition » avec l'évènement `DOMContentLoaded`) --- diff --git a/templates/page.tmpl b/templates/page.tmpl index a876f44..a48b008 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -37,6 +37,7 @@ <link rel="next" href="<TMPL_VAR NEXTURL>" title="<TMPL_VAR NEXTTITLE>" /> </TMPL_IF> </TMPL_LOOP> + <script defer src="<TMPL_VAR BASEURL>assets/scripts.js" type="text/javascript"></script> </head> <body class=""> <div class="body-wrapper"> @@ -226,6 +227,5 @@ <!-- <TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF> --> </div><!-- body-wrapper --> -<script src="<TMPL_VAR BASEURL>assets/scripts.js" type="text/javascript"></script> </body> </html>