Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Including jQuery without effecting other scripts
I am using a javascript that requires jquery in the header template like?

<script src=""></script>
<script src="images/clearclouds/scripts/nav.js"></script>

But when I have
<script src=""></script>

Included in my header the collapse & expand, and multiquote & delete postbit functions won't work.

How can I include jQuery without effecting any other scripts on MyBB?
I thought you knew how to do it :O

There are several things you could do. The easiest one is to replace the "$" in your jQuery code for something like "jQ" (that's IMO). As the "$" in jQuery means jQuery, but is different for prototype.

At the top of your jQuery code (before the first of your fuctions) add something like jQ = $; And done, just use jQ intead of $
All you need to do is call 'jQuery.noConflict();' and then just put 'jQuery' where you would put the '$'. And as combus said it could also work with 'jQ'. To use that it would be 'jQ.noConflict();'
I tried that noConflict code but than I only get to see the background of the site and the rests disappears...

Hold on...
Grm sorry for being a Dum Dum I forgot to define "jQ" in the "jQuery("div").hide();" part xD.

But this works Toungue
     // Use jQuery via jQuery(...)
     // Use Prototype with $(...), etc.
    // Use Prototype with $(...), etc.

^ That makes no sense >.> Just get rid of it. You're saying you want to hide <jQ></jQ> elements on the HTML

Forum Jump:

Users browsing this thread: 1 Guest(s)