Quantcast
Channel: How can I check if a jQuery plugin is loaded? - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by Eran Galperin for How can I check if a jQuery plugin is loaded?

$
0
0

Generally speaking, jQuery plugins are namespaces on the jQuery scope. You could run a simple check to see if the namespace exists:

 if(jQuery().pluginName) {     //run plugin dependent code }

dateJs however is not a jQuery plugin. It modifies/extends the javascript date object, and is not added as a jQuery namespace. You could check if the method you need exists, for example:

 if(Date.today) {      //Use the dateJS today() method }

But you might run into problems where the API overlaps the native Date API.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>