Nice helper for CSS rules, the only way I know of targeting IDs
containing spaces.
With CSS selectors however one can still use spaces when matching
attributes like IDs:
document.querySelectorAll('[id="123 foo bar lolwat"]');
--
Diego
On Wed, Sep 21, 2011 at 9:46 PM, Mathias Bynens wrote:
>
Michal Kuklis wrote:
> wow you guys have seriously way too much time... please, please just
> stop this already.
I think I will. I still don't understand Austin's rationale for
insisting -- without presenting evidence -- that XPath is so superior
to other selection methods. But it seems to have
: spaces in attribute values
Austin Cheney wrote:
Scott Sauyet wrote:
Let's talk real numbers here.
http://jsperf.com/xpath-vs-dom
This test is invalid. There are almost no valid examples where
operations per second account for any sort of performance associated
with web technologies.
com [mailto:jsmentors@googlegroups.com] On Behalf
Of Scott Sauyet
Sent: Tuesday, September 13, 2011 7:14 AM
To: The JSMentors JavaScript Discussion Group
Subject: [JSMentors] Re: spaces in attribute values
Austin Cheney wrote:
> Scott Sauyet wrote:
>> Let's talk real numbers here.
>>
>>
Austin Cheney wrote:
> Scott Sauyet wrote:
>> Let's talk real numbers here.
>>
>> http://jsperf.com/xpath-vs-dom
>
> This test is invalid. There are almost no valid examples where
> operations per second account for any sort of performance associated
> with web technologies.
You brought up p
ct: [JSMentors] Re: spaces in attribute values
Austin Cheney wrote:
> Scott Sauyet wrote:
>> You brought up XPath as an alternative to JQuery's
>> selectors API. JQuery (and most competing selector engines) claim to
>> support most if not all of CSS3.
>
> I ha
Matthias Reuter wrote:
>> Let's talk real numbers here.
>
>> http://jsperf.com/xpath-vs-dom
>
> I don't know if I understand the XPath correctly, but it seems to me, that
> the three examples don't do the same (actually, they do in the given
> example, but not in general.
You're right. The
Let's talk real numbers here.
http://jsperf.com/xpath-vs-dom
I don't know if I understand the XPath correctly, but it seems to me, that
the three examples don't do the same (actually, they do in the given
example, but not in general.
document.evaluate("../../h3", button, null, XPath
On Sat, Sep 10, 2011 at 2:45 AM, Scott Sauyet wrote:
> Austin Cheney wrote:
>> Scott Sauyet wrote:
>>> You brought up XPath as an alternative to JQuery's
>>> selectors API. JQuery (and most competing selector engines) claim to
>>> support most if not all of CSS3.
>>
>> I have compared XPath to CS
Scott,
I would add other parts that don't fit my requirements in XPath:
1) result set is not an array like, you must ".iterateNext()" and push
each item in the set
2) XPath "evaluate" method/interface is only available on the document
node object
3) It is too slow for the simplest selections compa
Austin Cheney wrote:
> Scott Sauyet wrote:
>> You brought up XPath as an alternative to JQuery's
>> selectors API. JQuery (and most competing selector engines) claim to
>> support most if not all of CSS3.
>
> I have compared XPath to CSS selectors.
Perhaps I misunderstood.
> jQuery is not compil
e execution of an XPath
expression should be roughly equivalent to a regular expression
operation, which is faster than DOM methods and certainly faster than a
jQuery index.
Thanks,
Austin Cheney, CISSP
-Original Message-
From: jsmentors@googlegroups.com [mailto:jsmentors@googleg
Austin Cheney wrote:
> Scott Sauyet wrote:
> Most of the advanced CSS selector examples you have provided are only
> CSS level 3, which less widely supported than XPath. Therefore many of
> arguments favoring use of CSS selectors for specific targeting less
> valid.
This entire discussion as I've
cess. I am not sure if this method is
supported in IE9.
Thanks,
Austin Cheney, CISSP
-Original Message-
From: jsmentors@googlegroups.com [mailto:jsmentors@googlegroups.com] On Behalf
Of Scott Sauyet
Sent: Thursday, September 08, 2011 9:10 PM
To: The JSMentors JavaScript Discussion G
Austin Cheney wrote:
> Scott Sauyet wrote:
>> CSS, though, was designed for progressive rendering (the only
>> exceptions I can come up with are the `:nth-last-*` selectors),
>> whereas XPath really only makes sense on a full DOM. I think that
>> explains much of the difference.
>
> I can't say I
Austin Cheney wrote:
> Scott Sauyet wrote:
>> On the other hand, can you find any better way to mimic `p.foo` than
>> the following?:
>
> I would just use //p[@class = "foo"]
> Of course, this looks for a class attribute whose value is only "foo".
> Outside of jQuery I see absolutely no value in su
heney, CISSP
-Original Message-
From: jsmentors@googlegroups.com [mailto:jsmentors@googlegroups.com] On Behalf
Of Scott Sauyet
Sent: Thursday, September 08, 2011 2:03 PM
To: The JSMentors JavaScript Discussion Group
Subject: [JSMentors] Re: spaces in attribute values
Austin Cheney wrote:
> S
Austin Cheney wrote:
> Scott Sauyet wrote:
>> how often do we really need to target something that can't be
>> expressed with CSS?
>
> All the time. How can I target the following with CSS?
>
> * parent
Can't do this, by design. This would be the primary advantage to
XPath
> * last child
p sp
JavaScript Discussion Group
Subject: [JSMentors] Re: spaces in attribute values
Nick Morgan wrote:
> Scott Sauyet wrote:
>> XPath is
>> inarguably more expressive than CSS. And it's designed for the same
>> sort of targeting that we expect in DOM scripting. So there i
Nick Morgan wrote:
> Scott Sauyet wrote:
>> XPath is
>> inarguably more expressive than CSS. And it's designed for the same
>> sort of targeting that we expect in DOM scripting. So there is a lot
>> to be said for using it. The biggest downfall is that it rarely gains
>> us anything; how often d
On Behalf
Of Scott Sauyet
Sent: Thursday, September 08, 2011 6:31 AM
To: The JSMentors JavaScript Discussion Group
Subject: [JSMentors] Re: spaces in attribute values
Nathan Sweet wrote:
> [ ... ] [T]he more I delve into building my engine
> the more I see that the ph
On 8 September 2011 12:30, Scott Sauyet wrote:
> Nathan Sweet wrote:
>> [ ... ] [T]he more I delve into building my engine
>> the more I see that the philosophical argument for using CSS is weak and
>> tenuous. I'm planning on building another engine soon that only works f
Nathan Sweet wrote:
> [ ... ] [T]he more I delve into building my engine
> the more I see that the philosophical argument for using CSS is weak and
> tenuous. I'm planning on building another engine soon that only works for
> the latest browsers only (a sort of high-end eng
23 matches
Mail list logo