javascript - Very simple jquery custom function throws error -
i have following code:
$(document).ready(function() { $.fn.addremovebutton = function() { alert(1); }; $.addremovebutton(); });
and following error message firebug:
typeerror: $.addremovebutton not function $.addremovebutton();
why , how can fix this?
you need define selector, try this:
$(document).ready(function() { $.fn.addremovebutton = function() { alert(1); }; $(document).addremovebutton(); });
Comments
Post a Comment