On May 28, 4:07 am, Karl Swedberg <k...@englishrules.com> wrote:
> On May 26, 2009, at 9:05 PM, RobG wrote:
>
> > The choice is clear - the OP can simply stop using jQuery selectors
> > for those elements, or stop using jQuery (or any other CSS selector-
> > based framework) at all.
>
> Really? That's the only choice? As others have already noted, you can
> simply escape the "."

Which infers "simply" hard coding all such IDs in the script, not a
sustainable strategy in a non-trivial application where the ID is
likely more efficiently passed as a parameter and therefore not a
viable option IMO.  The solution below doesn't require any hard coding
and conforms to the first choice proposed above.


> http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_...

Yes, we've seen that earlier in the thread.  I commented on it.


> > Given that it's an ID, the OP could use:
>
> >  $(document.getElementById('user.name'))...
>
> > Which is likely faster anyway.
>
> True, but the speed difference is likely negligible.

The comment about speed is primarily to indicate that it won't be
slower, so the option of quoting the period character has nothing to
recommend it.  The OP is, of course, free to chose whatever option
suits.


> > The jQuery
> > documentation does, after all, refer to them as "weird" and "special"
> > characters.
>
> If you think there is more appropriate terminology, feel free to
> change it. The documentation site is a wiki.


I'd rather let it stand.  It reflects the attitude of the author and
seems to have the support of at two posters here.


--
Rob

Reply via email to