Skip to content
Advertisement

Calling a method from an event handler

I have this code I am working on but every time I call init method I keep getting an error:

this.addElement is not a function

Is it because I can’t call methods from event handlers?

JavaScript

Advertisement

Answer

JavaScript

You should read this book, JavaScript: the Good Parts and visit the Crockenator’s web site here, crockford.com

You can also read about the JavaScript “this” issue here, http://www.quirksmode.org/js/this.html

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement