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 wrote:
> On May 28, 4:07 am, Karl Swedberg wrote:
>
> > On
CSS also allows character escaping:
#user\\.name { }
But guess which browser doesn't support that? In IE you'd have to use
a hex code: #user\2e name { }
On May 26, 5:21 pm, MorningZ wrote:
> So if you had:
>
>
>
> how would you apply a style to that?
>
> can't say:
>
> #user.name {
>
> }
>
>
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, clas
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 May 28, 4:07 am, Karl Swedberg 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?
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 27, 6:21 am, MorningZ wrote:
> So if you had:
>
>
>
> 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
>
>
>
> yeah, "poor choice" sure is relative, but why make things more
> diffi
$("#user\\.name")
seems to work in FF3. Haven't tried in other browsers.
On May 25, 10:09 pm, "weit...@263.net" wrote:
> when i use jquery get a input like
>
>
> use $("#user.name") is error
>
> if input is
>
> use $("#username") is right
>
> is bug?
So if you had:
how would you apply a style to that?
can't say:
#user.name {
}
because that would look for
yeah, "poor choice" sure is relative, but why make things more
difficult, when a simple dash or underscore would do the same thing
(and not cause issues with basic CSS or jQuery)
"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 wrote:
> No, it's not a bug, your selector is looking for an item of class
> "n
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
这个有人清楚么?我也比较好奇
'# 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, "weit..
13 matches
Mail list logo