Michael Geary schrieb: > Thanks again, I'm glad to know that little writeup may help straighten > out some of the confusion around "this" and jQuery vs. DOM objects. I recently experienced that the heavy use of apply() effectively prevents most object oriented design, that is, the use of pseudo-classes. If the method of an object can't access the object properties, because this is something else and not the object, the OO design is pretty useless. That forced me to rely heavily on closures to prevent code duplication. On that way I learned that hijacking the jQuery event system is a great tool to ease this: By defining and binding custom event handlers inside the "main" closure, I have access to everything necessary. And triggering the custom event is encapsulated inside it's own method, with standard docs.
Would be interesting to hear of others with a OO background and how they experienced this matter. -- Jörn Zaefferer http://bassistance.de _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/