A
A
adrenalinruslan2018-03-23 18:57:31
JavaScript
adrenalinruslan, 2018-03-23 18:57:31

What is the best way to include jQuery?

Guys, tell me please. How to include jQuery on a website. Using the CDN or download jQuery.js to the project folder and include this file.

Also, which version is better? Why do some connect the 1.x version, but do not connect the 3.x version.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
archelon, 2018-03-23
@archelon

It's best to connect from CDN, but use fallback to local version in case cdn is unavailable (google: jquery fallback from cdn to local).
Connect the old version for compatibility with old plugins.
Or for cross browser support ( https://jquery.com/browser-support/ If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use jQuery 1.12.)

F
Froggyweb, 2018-03-23
@Froggyweb

Why do some connect the 1.x version, but do not connect the 3.x version.

Because the plugins or application are written for version 1 and are not adapted for version 3. Oh ....
how to connect - it doesn't matter. If you connect the latest version from the CDN, there is a chance that it will end up in the user's browser cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question