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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…