Skip to content

Instantly share code, notes, and snippets.

@dsebao
Last active December 23, 2015 04:58
Show Gist options
  • Save dsebao/6583433 to your computer and use it in GitHub Desktop.
Save dsebao/6583433 to your computer and use it in GitHub Desktop.
Check if a plugin is loaded (Javascript)
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