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.
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
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,
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
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
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
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
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.
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
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
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
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
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
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
$(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() { ... });
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
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
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
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/
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
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
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
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
22 matches
Mail list logo