[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Pops
Sorry if I am a dounce, but I still don't see the invalidity of it. Do you have an example to show how this is incorrect in relationship to anything (DOM? CSS?) ? The technical problem I see using this wrapping method is that you get redundant (bubbling?) events. Is that right? Thanks -- HLS

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Karl Rudd
Err hmmm I thought I explained it. Let me try again. This is invalid: ul ulli/li/ul /ul This is valid: ul li ulli/li/ul /li /ul Anything that you want to put as a child of a list has to be either an LI or wrapped in an LI. That's just the way things are. Hmmm let's see if I can't

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Joel Birch
...so in browsers that do the error correction on this invalid markup, if you wrote this invalid HTML: ul liBlah/li liBlah/li ul liBlah/li /ul /ul and then wrote this jQuery code: $('ulul').doSomething(); you could not rely on it working, even though your HTML looks

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Karl Rudd
Thanks for finishing that off Joel. :) Karl Rudd On 9/6/07, Joel Birch [EMAIL PROTECTED] wrote: ...so in browsers that do the error correction on this invalid markup, if you wrote this invalid HTML: ul liBlah/li liBlah/li ul liBlah/li /ul /ul and then wrote

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Klaus Hartl
Pops wrote: Sorry if I am a dounce, but I still don't see the invalidity of it. Do you have an example to show how this is incorrect in relationship to anything (DOM? CSS?) ? ul and ol elements may only have li elements as children, that's written in the DTD.

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Klaus Hartl
Karl Rudd wrote: Thanks for finishing that off Joel. :) Joel and Karl, well explained, let's have a beer sometime :-) --Klaus

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Theodore Ni
Exactly. It is a subtle point, but lists do not contain other lists, they contain items which may be lists. On 9/6/07, Karl Rudd [EMAIL PROTECTED] wrote: He's referring to how lists (UL and OL) are built up in the DOM (from the HTML). Lists can only have LI elements as children. So these

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Theodore Ni
You're right. There isn't any technical problem at all, but it is a design decision the HTML designers made, for simplicity or whatever other reason. In the HTML specs, ul elements are only allowed children li elements: http://www.w3.org/TR/html401/struct/lists.html#edef-UL As mentioned, most

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-06 Thread Pops
On Sep 6, 4:50 am, Klaus Hartl [EMAIL PROTECTED] wrote: Pops wrote: Sorry if I am a dounce, but I still don't see the invalidity of it. Do you have an example to show how this is incorrect in relationship to anything (DOM? CSS?) ? ul and ol elements may only have li elements as

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Aaron Heimlich
On 9/5/07, Pops [EMAIL PROTECTED] wrote: Yes, $('#foobar') returns the 1st one, but you can have as many id=foobar your applications needs and use this to find them all: While that's technically true, IDs are meant to be unique to a page. For what you're describing, using CSS classes is more

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Pops
On Sep 5, 2:40 am, Aaron Heimlich [EMAIL PROTECTED] wrote: On 9/5/07, Pops [EMAIL PROTECTED] wrote: Yes, $('#foobar') returns the 1st one, but you can have as many id=foobar your applications needs and use this to find them all: While that's technically true, IDs are meant to be

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Aaron Heimlich
On 9/5/07, Pops [EMAIL PROTECTED] wrote: In practice, element ids are meant to be unique for practical purposes but there is no standard restriction that it there SHOULD NOT be more than one defined. Actually, but HTML 4.01[1] and XML 1.0[2] specify that IDs must be unique. From the HTML

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Klaus Hartl
Pops wrote: Thanks Klaus. I'm still learning. Maybe should show the light here. I have a 7 year old Windows HELP TOC generator that creates an UL list of about 500 links, its about 4 levels deep. ul lia ../ali lia ../ali lia ../ali ul lia ../ali lia ../ali /ul

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Aaron Heimlich
On 9/5/07, Pops [EMAIL PROTECTED] wrote: No, I am not describing CSS. Perhaps CSS classes wasn't the right term to use. What I really meant was that you should be using the HTML class attribute if you want to assign an identifier to many elements; it can be for many more things than just CSS

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Pops
Aaron, The bottom line really is then, in the internet world, there no really rules and consistent methods. You have PHP only methods, I have WCX only methods, others have their own methods. (Incidentally the PHP Windows developer use to work for us when it wasn't a big thing then. :-)) Many

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Pops
On Sep 5, 4:11 am, Klaus Hartl [EMAIL PROTECTED] wrote: Is that reallly the HTML? If so, it is invalid and you cannot expect any selector to be reliable in any browsers. I'm not refering to the missing slashes in the closing tag - I assume you just left them out in the example here -, but

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Pops
Klaus, Today, this has thrown me for a loop: Is that reallly the HTML? If so, it is invalid and you cannot expect any selector to be reliable in any browsers. I'm not refering to the missing slashes in the closing tag - I assume you just left them out in the example here -, but the

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-05 Thread Karl Rudd
He's referring to how lists (UL and OL) are built up in the DOM (from the HTML). Lists can only have LI elements as children. So these are valid: ul liblah/li /ul ul liblah ul liblah/li /ul /li /ul But these are invalid: ul ul liblah/li /ul /ul ul liblah/li

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Andy Matthews
Anyone have any input on this? Surely someone has written a tute on these semi-confusing methods. -- I've seen some of you jQuery masters bust out with these amazing chains, but I can't quite grasp how some of them are crafted.

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Sean Catchpole
I'll try to pull out the time later to write a more thorough response, but for now this is how you would code than line your pasted: $(label).not(:contains('nbsp;')) ~Sean On 9/4/07, Andy Matthews [EMAIL PROTECTED] wrote: Anyone have any input on this? Surely someone has written a tute on

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Andy Matthews
A... I wondered if there was a way to invert the contains() method. I have to say that's not all that intuitive...especially since you've got the contains() in quotes inside the not(). Thank you though for posting that. Hopefully that'll spur some really good experimentation. On Sep 4,

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Andy Matthews
: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sean Catchpole Sent: Tuesday, September 04, 2007 8:37 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods I'll try to pull out the time later to write a more thorough

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Pops
On Sep 4, 10:11 am, Andy Matthews [EMAIL PROTECTED] wrote: Hrm... But that didn't work. So I'm wanting to learn HOW I can do this sort of thing and a tutorial on these methods would help immensely. Have you tried the interactive Selector tester tool?

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Pops
On Sep 4, 2:42 pm, Pops [EMAIL PROTECTED] wrote: You can so do multiple selects, like find all divs and h3 $('div h3') but if you use the comma: $('div,h3') that says find the H3 tag that is within div, I think g I knew I had that backwards! $('div h3') finds all h3 within

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Klaus Hartl
Pops wrote: You can so do multiple selects, like find all divs and h3 $('div h3') but if you use the comma: $('div,h3') that says find the H3 tag that is within div, I think g It's vice versa. Find all div and h3 *elements*: $('div, h3') // grouping Find all h3 elements that are

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Pops
Thanks Klaus. I'm still learning. Maybe should show the light here. I have a 7 year old Windows HELP TOC generator that creates an UL list of about 500 links, its about 4 levels deep. ul lia ../ali lia ../ali lia ../ali ul lia ../ali lia ../ali /ul lia ../ali

[jQuery] Re: Request: Quick tutorial on jQuery filtering/limiting methods

2007-09-04 Thread Pops
On Sep 4, 2:53 pm, Andy Matthews [EMAIL PROTECTED] wrote: One issue though...$('#foobar') would only return the first occurrence of foobar because it uses getElementbyID which returns the first occurrence. That's desired behavior as there should only ever be one ID of a certain name per