Add 'defer' attribute to script tag CDN [suggestion] #33779
Unanswered
hamilton-jr
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm using Bootstrap 5 and I'm wondering if you should add defer attribute to script tag in the Bootstrap documentation. As the script should depends off DOM load, to add event handles... seems to be more correct to add this new attribute so users could insert the tag anywhere in HTML, could just add it to the end of HEAD tag, for example.
From:
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>To:
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>Beta Was this translation helpful? Give feedback.
All reactions