Kyle Hotchkiss
Kyle Hotchkiss

Reputation: 11112

How to find out which javascript library owns $

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

Answers (2)

epascarello
epascarello

Reputation: 207521

Another way to tell if it is jQuery

if($(document.body).jquery){alert("yep");}

Upvotes: 1

Borgar
Borgar

Reputation: 38652

You can test if two object are the same with the === operator:

if ( $ === jQuery ) {
  // $ is a reference to jQuery
}

Upvotes: 7

Related Questions