I wanted to add JavaScript and JQUERY to my website but I don't know in which folder do they go in. Like HTML files go in templates and CSS files go in static, what folder do they go in.
Asked
Active
Viewed 60 times
1 Answers
0
If you're looking to add jQuery to your website, it's generally a lot more reliable and fast if you serve one over CDN. You can add jQuery into your site's HTML by adding this script tag in your head or right before the closing </body>
tag. It's probably best to make it async/defer as well. That's up to dependencies/etc.
Here is the script you can add in your head:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Joel Hager
- 2,990
- 3
- 15
- 44
-
FWIW, I absolutely agree that using a CDN to deliver static files usually is the best solution, however, it is not if you are building an "embedded" application for use in the home, that is deliberately blocked from the Internet. In that case, we need to load such files locally. – user3481644 Jan 24 '23 at 19:34