Calling a method from an event handler?

Function editor () { var that = this; this. Init = function () { $("#area"). Bind('click' , this.

Click_event ); } this. AddElement = function () { console. Log("adding element"); } this.

Click_event = function(event) { that.addElement(); console. Log("click event in x : "+event. Data); } } 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.

Function editor () { var that = this; this. Init = function () { $("#area"). Bind('click' , this.

Click_event ); } this. AddElement = function () { console. Log("adding element"); } this.

Click_event = function(event) { that.addElement(); console. Log("click event in x : "+event. Data); } } 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.

Ayoub: Basically, this is very different in JavaScript than it is in some other languages, like Java or C#. It's determined entirely by how a function is called, not where it's defined. More: blog.niftysnippets.Org/2008/04/you-must-remember-this.

Html – T.J. Crowder Jun 17 '10 at 16:06.

Bind('click' , this. Log("click event in x : "+event. Bind('click' , this.

Log("click event in x : "+event. Terms of service. Not the answer you're looking for?

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

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions