0

I am trying to detect if a jQuery plugin is available, I tried

$.pluginName

but failed then tried

$().pluginName

it works. But whats the difference between the 2?

JM at Work
  • 2,417
  • 7
  • 33
  • 46

2 Answers2

3

You can look at this stackoverflow question only, they discussed a lot about this

How can I check if a jQuery plugin is loaded?

Community
  • 1
  • 1
kobe
  • 15,671
  • 15
  • 64
  • 91
3

You should be looking at $.fn.pluginName. jQuery's $.fn is an alias for $.prototype and that's where all the plugin names go. The top-level $.* namespace is reserved for jQuery's utility functions such as $.each() and $.grep().

mu is too short
  • 426,620
  • 70
  • 833
  • 800