Skip to content

Instantly share code, notes, and snippets.

@fvosberg
Created March 9, 2016 11:09
Show Gist options
  • Save fvosberg/c3974562dc05cb44c5ec to your computer and use it in GitHub Desktop.
Save fvosberg/c3974562dc05cb44c5ec to your computer and use it in GitHub Desktop.
Wrapper for jquery functions
function executeWithJquery(callback) {
(function($){
if(!$) {
if(typeof console === 'object') {
console.log('This plugin requires jQuery.');
}
return;
}
callback();
})((typeof jQuery !== "undefined" ? jQuery : null));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment