Hey, folks. I have a question about best practices for writing object-oriented code for use in jQuery. I've been working through understanding this issue and figured the geniuses on this forum would be the ones to ask for advice.
I've created an example page with documented source (don't worry, it's a really small example): http://briz.glyphix.com/js-scope/ I'm mostly interested in how to cleanly and reliably deal with scope issues in callbacks. More specifically: - When jQuery uses .apply() or .call() in its callbacks, how can one be sure of variable scope? - Is there any chance the jQuery.foo object will clobber other instances of the same object? - Or that these objects will become detached from their elements? - This is overkill for such a simple example, but is it a good approach for moderately complex code? -- _____________________________________ Brad Brizendine CTO, Glyphix http://www.glyphix.com/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
