Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: multiple jquery scripts
02-15-2011, 04:44 PM #1
- Join Date
- Feb 2011
- Thanked 0 Times in 0 Posts
multiple jquery scripts
I added a jquery megamenu to my site, but now my thichbox script is not working correctly. I have been pulling my hair out trying to get it to work. I added a noconflict statement and changed $ to jQuery in my jquery.js file, but it is still not working correctly. Any help would be greatly appreciated. Thanks!
<link href="http://www.homecomforts.com/js/thickbox.css" rel="stylesheet" />
02-15-2011, 06:30 PM #2
- Join Date
- Apr 2009
- Thanked 426 Times in 424 Posts
This looks like you don't have much of a plan what you are doing, willy-nilly embedding scripts.
First of all, you're not supposed to change your jQuery.js file. jQuery is supposed to stay the way you downloaded it. If you don't like something, file a bug report or a feature request.
Second, the first script you embed (jquery.js) is not only a very old version of jQuery, at the bottom of it there's also the thickbox script right inside that file. In the second line, you're embedding the thickbox script again, so that doesn't make a whole lot of sense.
Third, noConflict() is only needed when you add another framework, which also uses "$" as global object (which is not the case here).
Fourth, what are you doing, embedding another version of jQuery here (jquery.min.js)? You're suppsed to use one version of jQuery only, and that should be the most recent (1.5). In development you're supposed to use the full version for debugging purposes, in production the minified version. Also, you're encouraged to use a CDN (as opposed to serving it yourself), because many people will already have the CDN version in their browser cache.