Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2011, 03:44 PM   PM User | #1
fionajohnson
New to the CF scene

 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
fionajohnson is an unknown quantity at this point
multiple jquery scripts

Hi There,
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!

http://www.homecomforts.com/yosemite...-oy-sk2550.htm
--------------------------

<script type="text/javascript" src="http://homecomforts.com/js/jquery.js"></script>
<script type="text/javascript" src="http://homecomforts.com/js/thickbox.js"></script>
<script>
jQuery.noConflict(); </script>

<link href="http://www.homecomforts.com/js/thickbox.css" rel="stylesheet" />

<script type="text/javascript" src="/js/efriend.js"></script>
<script type="text/javascript" src="http://homecomforts.com/js/jquery.min.js"></script>
<script type="text/javascript" src="http://homecomforts.com/js/jquery.hoverIntent.minified.js"></script>
<script type="text/javascript" src="http://homecomforts.com/js/megamenu.js"></script>
----------------------------------
fionajohnson is offline   Reply With Quote
Old 02-15-2011, 05:30 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
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.
venegal is offline   Reply With Quote
Reply

Bookmarks

Tags
conflict, jquery

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:19 AM.


Advertisement
Log in to turn off these ads.