i wrote a little jQuery button plugin - it contains a method for applying the onclick-function - here's the code
(function ($) {
$.fn.tButton = function ()
{
this.setFN = function(fn)
{
alert("function set.");
}
};
})(jQuery);
i'm using this code to initialize it (on a div):
var button = $("#myButton").tButton();
now the problem: when trying to apply the setFN function:
button.setFN(function(){dosomething();});
i'm getting an error: button.setFN is not a function
i already tried this.bind instead but didn't help. anyone knows what's wrong?
See Question&Answers more detail:os