Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Thanked 0 Times in 0 Posts

    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!


    <script type="text/javascript" src="http://homecomforts.com/js/jquery.js"></script>
    <script type="text/javascript" src="http://homecomforts.com/js/thickbox.js"></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>

  2. #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.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts