Side navigation
#3091 closed bug (invalid)
Opened June 26, 2008 01:35PM UTC
Closed July 03, 2008 03:20PM UTC
Last modified July 04, 2008 04:51PM UTC
$('.myClass' + integer) does not work in IE
Reported by: | Ezel_Derbier | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | selector | Version: | 1.2.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I need to associate some database ID's to table rows. In order to do that, I use some class names. Here is an example :
<tr id="row55" class="procedure_row level2 section5 depends4">
When I want to target some rows by using one of their class names, I use a code like this :
var id = 4; var rows = $('.depends' + id);// is supposed to look for '.depends4'
This piece of code gives me three table rows in Firefox 3. This is correct. Nevertheless, I got no line in IE 8 beta 1 (used in 'Emulate IE 7' mode).
Attachments (1)
Change History (4)
Changed June 30, 2008 04:20PM UTC by comment:1
component: | core → selector |
---|---|
need: | Review → Test Case |
Changed July 03, 2008 02:39PM UTC by comment:2
I think I found where the problem is. This is not a problem of classes ended by numeric values. Instead, it is a kind of 'multiple lines in attributes' problem. I suppose this can affect any HTML attribute.
The content of my class attributes is written on more than one line, like in the exemple below. This does not cause any problem with Firefox but IE does not like it. Same problem in Safari 3.1 on Windows XP.
<!-- Do not work in IE --> <tr class="month someClass otherClass goodbye foo3 bar12 hello78">
<!-- IE is happy with single line --> <tr class="month someClass otherClass goodbye foo3 bar12 hello78">
Everything works in my test case when class attributes are written on a single line.
P.S. : sorry for my 'basic English'
Changed July 03, 2008 03:20PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | new → closed |
I think you can't put new lines inside attributes, it might be invalid html.
While some browsers will bear, it's still wrong.
I really don't think this needs a patch, just make them all new line.
Cheers
Changed July 04, 2008 04:51PM UTC by comment:4
I agree with you. I've just checked the HTML 4.01 Specification (section 3.2.2, about attributes), it says the following :
''The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58).''
User agents should not accept multilines values for HTML and XHTML attributes. Firefox seems to be too much tolerant, even when it renders pages in Standards mode.
Thank you
Can you please provide a test case ? that is, a small html file with the minimum html/css/js necessary to reproduce the problem.
Thanks