javascript - Ace.js .on event -



javascript - Ace.js .on event -

i have few ace.js editors on 1 page. stored in array.

how determine editor come in text?

var editor = {first: ace.edit("editor"), second: ace.edit("editor1"), third: ace.edit("editor2")}; for(var in editor) { editor[i].getsession().setmode("ace/mode/javascript"); editor[i].on('input', function() { console.log(this); // how current editor? returns [function()] }); }

jsfiddle: http://jsfiddle.net/3nhas/25/

thanks in advance.

do want element? or instance of editor? regardless, should find need in sec parameter of called function.

editor[i].on('input', function(e, target) { console.log(target); });

javascript ace-editor

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -