javascript - $(...).functionName() is not a function - Why it occurs and how to avoid this? -


i getting console error

$(...).functionname() not function


this function call

$("button").functionname(); 


function

$.fn.functionname = function() {        //do }(jquery); 


why error comes , how avoid error?

try using following syntax:

jquery.fn.extend({     functionname: function () {      } }); 

Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -