Add event listener of a method present in another js file
问题 I am accessing few methods written in another js file. So i'm accessing them like this: file1: function minit() { this.addval = function(val1, val2) { return val1 + val2; } function autoexecute(d) { //do something here// //raise event// } }; file2: var con = new minit(); var result = con.addval(2, 3); /* con.autoexecute(function(d) { //Wanna do something like this alert(d); }); */ Above things are working as expected, getting result.. Now, Suppose autoexecute(d) method is invoking