novex — 2014-03-25T09:14:28-04:00 — #1
I am adding a Git-based contact form w captcha on my bootstrap3 site; I'm not that averse on adding scripts and plugins yet.
Before the closing body tag I currently have
The code example for the contact form has
Is this more or less the same jquery.js asset just with a different address, so I should replace mine? Or is the latter specific to my form, and I should keep both? Many thanks.
novex — 2014-03-25T09:52:14-04:00 — #2
I am thinking this references the ajax library for the captcha, and that I should keep both scripts.?.
pullo — 2014-03-25T09:57:04-04:00 — #3
Don't keep both scripts.
You should only include jQuery once per page.
mittineague — 2014-03-25T11:01:11-04:00 — #4
AFAIK the first will get the latest stable release version (which may or may not be what other code needs), and the second gets a specific version.
If someting breaks because of incompatibility you can either include the version it needs or figure out what differences caused the problem(s) and modify the code.
But as Pullo mentioned, you should not use more than one version per page.
pullo — 2014-03-26T03:02:54-04:00 — #5
will pull the latest, non-minified version of the 1.x branch of jQuery from jQuery's own cdn.
This is currently v1.11.0
will pull in a minified version of jQuery v1.10.2 from Google's cdn.
Notice the missing http:// at the begining of the url.
This will cause things to break if you test locally, but has advantages when used on a server (namely the browser will use the page's protocol to try to obtain the file. On non-secure pages, http. On secure pages, https).
In your case I would use a specific, minified version.
Here is an interesting link on why it is best to include jQuery from Google's cdn: http://stackoverflow.com/questions/2180391/why-should-i-use-googles-cdn-for-jquery
novex — 2014-03-26T09:52:12-04:00 — #6
Thank you. I was interested in the difference btwn the 2 as well, so these answers are very helpful.