Reputation: 11112
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!
Upvotes: 1
Views: 193
Reputation: 207521
Another way to tell if it is jQuery
if($(document.body).jquery){alert("yep");}
Upvotes: 1
Reputation: 38652
You can test if two object are the same with the ===
operator:
if ( $ === jQuery ) {
// $ is a reference to jQuery
}
Upvotes: 7