It's not that hard to create a function that escapes special
characters in case you need it. It's the same issue as with CSS,
jQuery can't escape anything automatically because it can't guess what
you're after.
On May 27, 8:09 pm, RobG rg...@iinet.net.au wrote:
On May 28, 4:07 am, Karl Swedberg
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
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
I know i wouldn't call them weird, but i would for sure classify
using something like user.name as *problematic* or even unnecessary
pain in the a__ as a programmer living and dying by jQuery, lol...
whatever though... to each their own that's the beauty of this
field of work :-)
On
The HTML spec allows characters in ids that the CSS selector spec
(used by jQuery) requires to be escaped. Is there some solution that
has been overlooked by jQuery and the W3C?
http://www.w3.org/TR/2009/CR-CSS2-20090423/syndata.html#characters
In CSS, identifiers (including element names,
'# ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens (-),
underscores (_), colons (:), and periods (.).'
http://www.w3.org/TR/html401/types.html#type-name
So it would seem to be a bug.
On May 26, 4:09 am,
这个有人清楚么?我也比较好奇
No, it's not a bug, your selector is looking for an item of class
name... so it's your selector that is the issue, not jQuery (your
naming/id convention would also cause issues with CSS)...
If you insist on poor choices for naming your controls, it is still
possible to select the items though
Poor choices is relative. I'd love a way to use colons in IDs
avoiding the confusion with pseudo-selectors, kind of like namespacing
elements. If it's in the specs it's perfectly valid.
On May 26, 9:17 am, MorningZ morni...@gmail.com wrote:
No, it's not a bug, your selector is looking for an
So if you had:
input type=text id=user.name /
how would you apply a style to that?
can't say:
#user.name {
}
because that would look for
input type=text id=user class=name /
yeah, poor choice sure is relative, but why make things more
difficult, when a simple dash or underscore would do
$(#user\\.name)
seems to work in FF3. Haven't tried in other browsers.
On May 25, 10:09 pm, weit...@263.net weit...@263.net wrote:
when i use jquery get a input like
input type=text id=user.name name=user.name/
use $(#user.name) is error
if input is
input type=text id=username
On May 27, 6:21 am, MorningZ morni...@gmail.com wrote:
So if you had:
input type=text id=user.name /
how would you apply a style to that?
Using a class or a selector other than the id.
can't say:
#user.name {
}
because that would look for
input type=text id=user class=name /
12 matches
Mail list logo