Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript self executing function "is not a function"

Tags:

People also ask

What are self executing functions JavaScript?

The self-executing anonymous function is a special function which is invoked right after it is defined. There is no need to call this function anywhere in the script. This type of function has no name and hence it is called an anonymous function. The function has a trailing set of parenthesis.

Is not a function in JavaScript?

The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function.

What is not a function?

A function is a relation in which each input has only one output. In the relation , y is a function of x, because for each input x (1, 2, 3, or 0), there is only one output y. x is not a function of y, because the input y = 3 has multiple outputs: x = 1 and x = 2.

How do I fix uncaught TypeError is not a function?

The TypeError: "x" is not a function can be fixed using the following suggestions: Paying attention to detail in code and minimizing typos. Importing the correct and relevant script libraries used in code. Making sure the called property of an object is actually a function.


I have:

var Init = (function() {    my js goes here })(); 

And my js executes correctly when the page is loaded. I also have:

$('form :checkbox').change(function() {    Init(); }); 

But firebug says Init is not a function.