Last active
December 23, 2015 04:58
-
-
Save dsebao/6583433 to your computer and use it in GitHub Desktop.
Check if a plugin is loaded (Javascript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if($().nombrePlugin) { | |
| // if nombrePLugin is loaded and available | |
| } | |
| //OR | |
| if($.fn.nombrePlugin !== undefined) { | |
| // if nombrePLugin is loaded and available | |
| } | |
| //Similar to above but Safe when you are using other JS frameworks Mootools etc. | |
| if(jQuery().nombrePlugin) { | |
| // if nombrePLugin is loaded and available | |
| } | |
| //OR | |
| if(jQuery.fn.nombrePlugin !== undefined) { | |
| // if nombrePLugin is loaded and available | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment