<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jul 21, 2006, at 4:47 PM, Andreas Wahlin wrote:</DIV><BLOCKQUOTE type="cite"><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><SPAN class="Apple-style-span" style="color: rgb(0, 0, 221); ">If you use prototype, there's a modified version in there that adds </SPAN><B style="color: rgb(0, 0, 221); font-weight: bold; "><SPAN class="Apple-style-span" style="color: rgb(0, 0, 221); font-weight: bold; ">.bind(this)</SPAN></B><DIV style="color: rgb(0, 0, 221); "><BR class="khtml-block-placeholder"></DIV>*cough* slightly off topic. The .bind(this) just makes the this keyword accessibly in the function that you bind it to, right? Sort of like passing it in as an argument when you call the function.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Andreas</DIV></SPAN></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Monaco" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">.bind()</SPAN></FONT> replaces every use of "this" inside with a call to the object you put in the argument. Like so:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><I><DIV><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px; font-style: normal;">function(){</SPAN></FONT></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">   </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px; font-style: normal;">alert(this.thinggy);</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px; font-style: normal;">}.bind({thinggy: 'Howdy!!!'})</SPAN></FONT></DIV><SPAN class="Apple-style-span" style="font-style: normal;"><DIV><BR class="khtml-block-placeholder"></DIV><BR></SPAN></I><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style=""><FONT class="Apple-style-span" size="4"><SPAN class="Apple-style-span" style="font-size: 14px;"><SPAN class="Apple-style-span" style="font-size: 14px; "><SPAN class="Apple-style-span" style="font-size: 14px; ">thomas Aylott—</SPAN></SPAN></SPAN></FONT><B style="font-weight: bold; "><SPAN class="Apple-style-span" style="font-weight: bold; "><SPAN class="Apple-style-span" style="font-weight: bold; ">subtleGradient</SPAN></SPAN></B></DIV></SPAN><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>