[jQuery] How to bind an event to a function of a class?

2006-08-15 Thread Webunity | Gilles van den Hoven
Hi Guys, How can i bind/unbind an event to a specific function of a class? e.g. class { somecallback() { }, somefunc() { $(document).keypress(this.somecallback); }, otherfunc() { $(document).unkeypress(this.somecallback); } } Is this possible? Thanx,

Re: [jQuery] How to bind an event to a function of a class?

2006-08-15 Thread Christian Bach
Hi, Is this what you mean? var test = new TestClass(); function TestClass() { function callback() { alert('fired!'); }