I have a question which at the first glance might seem to be stupid. I got problem figuring it out and whenever I use it, nothing really happens. I have a plugin in jQuery written by myself which is like this:
(function(){
$.fn.myPlugin = function(options){
var options = $.extend({
firstParameter : null;
}
// the rest of the plugin
})(jQuery)
But when I call it from an HTML file, like this: ("#object").myPlugin(2);, it fails to work (note the parameter that I have passed). But if I skip the argument and call it like this: ("#object").myPlugin();, it all works. What is the problem?
Thanks in advance
optionsis meant to be an object, and you're not extending anything... Double check the manual again, you're missing something.optionsin the first line.