Re: [jQuery] simple selector with ID doesn't work anymore

2007-02-04 Thread Roger
I am having the same issue with the latest jquery. Has it been fixed or is there a workaround ? Thanks Roger -- View this message in context: http://www.nabble.com/simple-selector-with-ID-doesn%27t-work-anymore-tf3080046.html#a8792927 Sent from the JQuery mailing list archive at Nabble.com.

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
I have a somewhat similar problem with ID selectors, and I posted a message about it and a bug but so far I haven't gotten a single response from anyone (here's the bug: http://jquery.com/dev/bugs/bug/881/). My problem is IDs preceded by a class or another ID (i.e. .myClass #myId or #firstId

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Giuliano Marcangelo
Jennifer, I am far from being an expert, but as you know an id must be unique..therefore .myClass #myId is not necessary to target #myId.surely you should only target the idsame with #firstId #secondIdsimply declare the id that you wish to target hth On 25/01/07,

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
Yeah I know that, but consider this situation: Two different kinds of pages each have an element with the same ID. I want my Javascript to only affect the element on one of those pages. So I precede the ID with the class name I use for that page type, to target the right one. Isn't this a

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Aaron Heimlich
On 1/25/07, jgrucza [EMAIL PROTECTED] wrote: Two different kinds of pages each have an element with the same ID. I want my Javascript to only affect the element on one of those pages. So I precede the ID with the class name I use for that page type, to target the right one. Isn't this a

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Karl Swedberg
Hi Giuliano, I tried to reproduce your problem, but both types of selectors worked fine for me. I used jQuery 1.1.1 packed (Rev. 1173). You can see the test here: http://test.learningjquery.com/ids.htm Here is the relevant script and css placed in the head: script type=text/javascript

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
Actually it was my problem, not Giuliano's. And I failed to mention an important fact, that I only get the error when my HTML does not include the element I'm selecting for. Also it has gotten weirder, because now I'm getting the same error with previous versions of jQuery, even though I know I

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Aaron Heimlich
On 1/25/07, Karl Swedberg [EMAIL PROTECTED] wrote: I used jQuery 1.1.1 packed (Rev. 1173). And that solves it! The release version of jQuery 1.1.1[1] is SVN Rev. 1153 and you claim[2] to be using SVN Rev. 1173. This issue must have gotten fixed sometime after 1.1.1 was officially released.

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Olaf Bosch
jgrucza schrieb: Yeah I know that, but consider this situation: Two different kinds of pages each have an element with the same ID. I want my Javascript to only affect the element on one of those pages. So I precede the ID with the class name I use for that page type, to target the right

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Yehuda Katz
I suspect that [EMAIL PROTECTED] would work, although again, I would not rely on bad XHTML. -- Yehuda On 1/25/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 1/25/07, jgrucza [EMAIL PROTECTED] wrote: Two different kinds of pages each have an element with the same ID. I want my Javascript

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Yehuda Katz
Why not just have a container (say... html) have the class of that page type. Then you can do $(html.this div#id) -- Yehuda On 1/25/07, Olaf Bosch [EMAIL PROTECTED] wrote: jgrucza schrieb: Yeah I know that, but consider this situation: Two different kinds of pages each have an element

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
Yeah that's basically what I'm doing. But I'm getting an error message with that selector for pages where there are no matching elements. wycats wrote: Why not just have a container (say... html) have the class of that page type. Then you can do $(html.this div#id) -- Yehuda On

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
Sorry, I don't understand what you're saying. Here's my use case: Page type 1: body class=pageTypeOne form ... input type=text id=certainKindOfInputBox/ /form /body Page type 2: body class=pageTypeTwo form ... input type=text id=certainKindOfInputBox/ /form

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Karl Swedberg
On Jan 25, 2007, at 3:54 PM, jgrucza wrote: Actually it was my problem, not Giuliano's. And I failed to mention an important fact, that I only get the error when my HTML does not include the element I'm selecting for. Also it has gotten weirder, because now I'm getting the same error with

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Ⓙⓐⓚⓔ
$(body.pageTypeTwo) .children(#certainKindOfInputBox).click(...) .end() should work too.. but you could keep the chain for more stuff that pertains to type 2 pages. right? $(.pageTypeTwo #certainKindOfInputBox).click(function() { ... }); -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Karl Swedberg
On Jan 25, 2007, at 3:56 PM, Aaron Heimlich wrote: And that solves it! The release version of jQuery 1.1.1[1] is SVN Rev. 1153 and you claim[2] to be using SVN Rev. 1173. This issue must have gotten fixed sometime after 1.1.1 was officially released. Good idea, but that's not it. I just

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Karl Swedberg
On Jan 25, 2007, at 4:56 PM, Aaron Heimlich wrote: The error occurs when the *first* ID selector doesn't exist. See my test page for an example: Ah, yes! You are correct! Jennifer, you are not going crazy. ;-) Anyone want to file a bug report? --Karl _ Karl Swedberg

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Giuliano Marcangelo
How about, $('#main-content').find('#fourth-para').addClass('test2'); that does not throw an exception ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread jgrucza
Hooray! So glad it's reproducable. I had previously entered a bug here: http://jquery.com/dev/bugs/bug/881/ Jennifer On Jan 25, 2007, at 4:56 PM, Aaron Heimlich wrote: The error occurs when the *first* ID selector doesn't exist. See my test page for an example: Ah, yes! You are

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Karl Swedberg
On Jan 25, 2007, at 5:12 PM, Giuliano Marcangelo wrote: How about, $('#main-content').find('#fourth-para').addClass('test2'); that does not throw an exception Absolutely! But, the other is still a bug. Glad to see that Jennifer logged it. That's one of the things about jQuery that makes

[jQuery] simple selector with ID doesn't work anymore

2007-01-24 Thread vincent . fuchs
Hi, I've just upgraded from 1.0.3 to 1.1.1 and some selectors don't work anymore. A simple selector like $(div#tab_1) cant' find the div div id=tab_1 in v1.1.1 while there was no problem with v1.0.3 . So unless the selecting philosophy has greatly changed between these two versions, I guess

Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-24 Thread j. siefer
hi, tiny hint $(div#tab_1) is slower then $(#tab_1) to your problem, i think your error might be somewhere else, maybe you gave your object with $('div').id('tab_1') // this will not work anymore $('div').attr('id','tab_1') // you have to do it like this, maybe you got stucked there some