An old topic with lots of discussions... I read many of them but still not sure...
What is the best place and best script's tags (defer/async) to locate the bootstrap-4 JS scripts for the best performance?
In Bootstrap documentation: "Place the following s near the end of your pages,right before the body closing tag
They don't use any script tags (defer/async)
I read about the scripts tags, Some wrote that locating the script before the body closing tag is like locating the heading with "defer" tag. (except for the old browsers) some say "performance would be better if the scripts are still at the end, as they will be downloaded later"
So is the following the best practice ???
Locating jquery/popper/bootstrap before the body closing tag, jquery first and using defer to popper.min.js and to bootstrap.min.js?
<body> ...... <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script defer src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script defer src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" ></script> </body>
Or just doing as in the bootstrap documentation without the "defer" tag??