I don't think that ".class #id" generates an error it was a bug of jQuery because,
simply it is an error this string....

#id .class <- get the element with id "id" only if has the class "class" but.. .class #id ¿?¿?¿? If you can get the element with id "id", why don't you select directly? #id

The id is unique so you don't need preselect a class first. Also, if you want select the element #id
and all the elements .class, then ".class, #id" works.

Luc Pestille escribió:
I think I've found a bug in jQuery with regards to IE -a blank .html page, with just the latest uncompressed jquery.js and a script file (linked in the header) that looks like this: /* <![CDATA[ */
// when the DOM is ready to be manipulated do some voodoo.
$(document).ready( function(){
    $(".search-advanced #classtest").hide();
});
/* ]]> */
produces an error in IE6 and IE7 (the line number is different in IE7); ---
Line 968
Error: 'getElementById' is null or not an object
---
however, these selectors produce no such error; $("#search-advanced .classtest").hide();
$(".search-advanced .classtest").hide();
$("#search-advanced").hide();
So it looks like IE doesn't like double ID selectors, or an ID selector after a space. Anyone seen this before, or can reproduce it? I'd rather not have to re-write bits of my site to use classes instead of IDs.

*Luc Pestille*
Web Designer

------------------------------------------------------------------------
*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Luc Pestille
*Sent:* 29 May 2007 09:51
*To:* jquery-en@googlegroups.com
*Subject:* [jQuery] Re: IE selector bug/error?

Anyone have any idea on this? Non-existant selctors are breaking IE, which is fairly bad news for me!
Thanks,

*Luc Pestille*
Web Designer

------------------------------------------------------------------------
*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Luc Pestille
*Sent:* 23 May 2007 15:19
*To:* jquery-en@googlegroups.com
*Subject:* [jQuery] IE selector bug/error?


        
I've found something that I can't get around; in IE6, these selectors won't do anything for me; 1. $("#admin-jobs #discipline_client_row").hide();
2. $("#admin-jobs > #discipline_client_row").hide();
whereas this works fine (as you'd expect); 3. $("#discipline_client_row").hide(); In IE, number 1 gives me the error (when that div doesn't exist on the page):
---
Line: 184
Error: 'getElementById' is null or not an object
---
but number 2 reports no error, despite not finding the div on the page. Has anyone come across this before? Any help would be appreciated, IE is starting to drive me in to a coma. Thanks,
*Luc Pestille*
Web Designer


In2
Thames House
Mere Park
Dedmere Road
Marlow
Bucks
SL7 1PB
Tel 01628 899700
Fax 01628 899701
e: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
i: www.in2.co.uk <http://www.in2.co.uk/>

This message (and any associated files) is intended only for the use of jquery-en@googlegroups.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not jquery-en@googlegroups.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author [EMAIL PROTECTED] and do not necessarily represent those of the company.

in2 logo



--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org
Murcia - Spain

Reply via email to