Hello I’m somewhat past the newbie stage of javascript and am looking at how a certain widget library works. (All printed out code, can’t copy and paste) I condensed it so I hope it’s enough for you guys to understand.
Page.prototype.createForm= function (){
....
this.form1 = new Form();
....
this.form1.clickEvent(this,"clickedDelete");
};
Page.prototype.clickedDelete= function (){
....
};
So my question is what the this inside ClickEvent mean?
this.Form.clickEvent(this,”clickedDelete”)
I hope this is enough information, but anyways, what is this inside
(this,"clickedDelete")
referring to?
is it the page object or page.form1 (thus called this.form1?)
If this is too little information, can you provide any links or examples of your own that’s somewhat close to this example. Thank you.
thisrefers to whatever object the currently executing function is called on — in your example, it is thePageobject, assuming it is called along the lines ofpage.createForm().