Tag Archives: Basic knowledge of

JS error – typeerror: XXX is not a function

In today’s work, there is a check box for the onchage event binding function that clearly has been implemented. Typeerror: XXX is not a function Typeerror: XXX is not a function Uncaught ReferenceError: AA is not defined, but the error message is different. Carefully contrasting the two errors, “is not defined” means the type is not defined. Is not a function means that the type is not of function type. After searching Baidu, it is found that some browsers can directly find the changed element through the element ID in the JS code, and then rewrite the defined function by the element in the DOM, which will lead to the error is not a function.


solution:
modify the element ID value, or modify the name of the function.
Of course, not all errors of this type are caused by this reason, and it should be analyzed on a case-by-case basis.