+ 3

What is the best way to load a jquery on a web page?

I can see that integrating third party libraries with jquery is sometimes very confusing and tricky. Suppose if I integrate bootstrap library, jquery library is loaded end of the body with bootstrap bundle scripts. I have seen many websites that jquery is linked on head and do jquery related task when document is ready. What do you think the best approach can be to solve this problem?

7th Jul 2020, 2:00 AM
Shimax
Shimax - avatar
4 odpowiedzi
+ 3
No i mean what is the best place to load jquery? is it head or very bottom of body tag?
7th Jul 2020, 4:22 AM
Shimax
Shimax - avatar
+ 2
Shimax It is common practice to import stylesheets and scripts (like jQuery, Bootstrap, SweetAlert, FontAwesome etc.) in the <head> element.
7th Jul 2020, 6:48 AM
Rowsej
Rowsej - avatar
+ 2
thanks Rowsej
7th Jul 2020, 6:58 AM
Shimax
Shimax - avatar
+ 1
Do you mean that you’re loading Bootstrap with jQuery? You can include the link(s) for Bootstrap directly - copy and paste from https://getbootstrap.com (you may have to scroll down a bit).
7th Jul 2020, 3:01 AM
Rowsej
Rowsej - avatar