I'm testing a Plupload script when I keep getting `Uncaught TypeError: undefined is not a function .
Not able to figure out why, I tested with an example from jQuery. I get the same error (se fiddle).
Can anyone tell me why this isn't working?
Code:
$( "div" ).greenify({
color: "orange"
});
(function ( $ ) {
$.fn.greenify = function( options ) {
// Do stuff here
};
}( jQuery ));
Because you have those in the wrong order:
// First add the plugin
(function ( $ ) {
$.fn.greenify = function( options ) {
// Do stuff here
};
}( jQuery ));
// THEN use it
$( "div" ).greenify({
color: "orange"
});
The general order of things is:
script
tag for jQueryscript
tags for any pluginsscript
tag(s) for your codeCollected from the Internet
Please contact [email protected] to delete if infringement.
Comments