I am new with javascript still, but I would like to know how to check if a library is supposed to be using $ and then do an if statement off of it. Sorry if I have a hard time asking this!
+7
A:
You can test if two object are the same with the ===
operator:
if ( $ === jQuery ) {
// $ is a reference to jQuery
}
Borgar
2009-07-17 22:14:11
$ === window.jQuery would work better in case jQuery isn't being used.
Joe Chung
2009-07-18 07:23:47
+1
A:
Another way to tell if it is jQuery
if($(document.body).jquery){alert("yep");}
epascarello
2009-07-18 04:10:01