Skip to content Skip to sidebar Skip to footer

Understanding Prototype Method Calls

In trying to call a method on the CodeMirror javascript code editor. I'm new to javascript and trying to understand how object oriented stuff works. I'm having problems calling w

Solution 1:

Probably yoour code should be something like this:

var editor = newCodeMirror.fromTextArea('code', options);
editor.grabKeys(function(e) { alert("Key event");});

Notice the 'new' operator..

Here is a good explanation of what prototype method calls are for:

http://www.javascriptkit.com/javatutors/proto.shtml

Post a Comment for "Understanding Prototype Method Calls"