Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aerohub/hugo-identity-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grosser <development@stp-ip.net>2017-06-26 16:20:12 +0300
committerMichael Grosser <development@stp-ip.net>2017-06-26 16:20:12 +0300
commit1529b1726901215656ae2654680063258353233b (patch)
tree0624982d42ac8146f6cbf8c91efefdfc9195403b
parent3802cc2dcb1ad453d5d109fd1060e904de464b48 (diff)
Fix race of js scripts
Add async and defer to load jquery requiring scripts last. Fixes: #14
-rw-r--r--layouts/partials/footer_scripts.html10
1 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/footer_scripts.html b/layouts/partials/footer_scripts.html
index 7a04e84..b07bbd9 100644
--- a/layouts/partials/footer_scripts.html
+++ b/layouts/partials/footer_scripts.html
@@ -9,10 +9,10 @@
{{ if .Site.Params.contact.enable }}
{{ "<!-- Form Validation -->" | safeHTML }}
- <script src="{{ "assets/js/jquery-v3.3.1/jquery.min.js" | absURL }}"></script>
- <script src="{{ "assets/js/bootstrap-v3.3.7/bootstrap.min.js" | absURL }}"></script>
- <script src="{{ "assets/js/jquery.form-validator-v2.3.44/jquery.form-validator.min.js" | absURL }}"></script>
- <script src="{{ "assets/js/contact.js" | absURL }}"></script>
+ <script src="{{ "assets/js/jquery-v3.3.1/jquery.min.js" | absURL }}" async></script>
+ <script src="{{ "assets/js/bootstrap-v3.3.7/bootstrap.min.js" | absURL }}" async></script>
+ <script src="{{ "assets/js/jquery.form-validator-v2.3.44/jquery.form-validator.min.js" | absURL }}" async></script>
+ <script src="{{ "assets/js/contact.js" | absURL }}" async defer></script>
{{ end }}
{{ template "_internal/google_analytics_async.html" . }}
@@ -22,7 +22,7 @@
{{ end }}
{{ range .Site.Params.custom_js }}
- <script src="{{ . | absURL }}"></script>
+ <script src="{{ . | absURL }}" async defer></script>
{{ end }}
{{ with .Site.Params.contact.captcha }}