<div class="gmail_quote">On Wed, Oct 14, 2009 at 9:34 AM, Andrew Powell <span dir="ltr"><<a href="mailto:powella@gmail.com">
powella@gmail.com</a>></span> wrote:
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Well, you asked for input. While I think that the 'element' accessor
is a good idea, I think it's too confusing and too ambiguous when you
have an internal targeted element variable referenced by the shorthand
'elem' and then also an accessor for element, referenced by the long
hand name 'element'. It's non-semantic and non-contextual, which is
pretty much the opposite of how I've seen code written for jQuery UI
to date.
</blockquote><div>
</div><div>Do you think the method name element is ambiguous or the property name elem is ambiguous? Or both? Or both, but only when they exist simultaneously?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I dunno how this.target would get confused, as it's just a matter of
scope. Event targets are scoped within the event, where devs should be
using 'self' or 'that' anyhow.
</blockquote><div>
</div><div>This is actually going to change as soon as 1.4 lands. Events should be bound in the context of the plugin and this will then point to the plugin, not the DOM element. Anyway, this.target would never exist in a standard event, it would always be event.target, as this defaults to the DOM element, not the event object.</div>
<div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">If you guys aren't interested in hearing concerns over the change and
just want to defend what you already think is right, please just state
that much. Your last reply was basically just 'no' without addressing
the concerns I raised.
</blockquote><div>
</div><div>We are interested in hearing feedback. You objected saying that the naming would be confusing, Richard objected to your proposal for the same exact reason. I happen to agree with Richard; target is never used in jQuery code to mean anything other than an event target, whereas elem is used to reference the main element within a function quite often. We're open to other names (and I hope we find something that removes all ambiguity), but I personally don't think target is better than elem.</div>
</div>