Tag Archives: jQuery

Another reason why I love JQuery

Today I was integrating Lightbox 2 into my wordpress instance which caused a conflict between the Prototype and JQuery namespaces.

… I made it sound like I knew what the problem was right away, but it did take me some troubleshooting to figure out the issues.

JQuery has an awesome ability to change it’s namespace from the usual ‘$’ to any variable you want with one simple line of code:
var JQ = jQuery.noConflict();

Now, instead of calling $(“myDiv”).doSomething(); I call JQ(“myDiv”).doSomething();

Worked like a charm!