Maybe this is simple for some of you but how to add
$.functionName(args)
I've read and tried with jQuery.extend
and with $.fn
:
$.fn.alertSometing = function(param) {
alert(param);
};
But when I run
$('.button').on('click', $.alertSometing('something'));
Returns this error:
Uncaught TypeError: $.alertSometing is not a function(anonymous function)
This is my code: http://jsbin.com/kuxomofoka/edit?html,js,console,output
Can someone explain me how to achive that or explain what I'm doing wrong?
Thanks!