Skip to main content

Bug Tracker

Side navigation

#5424 closed bug (invalid)

Opened October 29, 2009 08:13PM UTC

Closed October 30, 2009 12:22AM UTC

Last modified October 30, 2009 12:29AM UTC

append(string) not working in IE8

Reported by: JeffMatthews Owned by:
Priority: critical Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

On initial page load, there is a function call to laod information into a span:

addStateToNavigation("AL","Alabama");

function addStateToNavigation(id,name,chamberName1,unicameral)

{

<other code precedes this snippet>:

divString=divString+'<div><img class="checkBox" src="VSCheckBoxEmpty.jpeg"/><span class="Senate">Senate</span></div>';

}

divString=divString+'</div>';

$("#allStates").append(divString);

} //end of function

The <span> in html body is: <span id="allStates"></span>

The span appends fine in FireFox and Chrome. It does not append in IE8.

I marked this as "critical," because if it really is a bug, it makes a critical difference in terms of how to priogram for browser incompatibility. Potentially, complete re-writes would be necessary.

For full page info and source, see: http://sovereignstates.net/StateLegislators/VSLegislators.htm

Attachments (0)
Change History (5)

Changed October 29, 2009 11:14PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Block elements (divs) should not be put inside an inline element (span). I don't know if IE allows it but you shouldn't be doing it, especially since the self-closing tags imply the cleanliness of XHTML. http://www.w3.org/TR/html401/struct/global.html#h-7.5.3

It's hard to tell from the code snippet, but it appears that there is an extra closing div tag.

The full page is too big for a test case. Please reduce it to the minimum amount of code and html required to show the problem, and make sure the markup is well formed. You might want to run it by some other eyes on the forums first.

Changed October 30, 2009 12:04AM UTC by JeffMatthews comment:2

No missing <div>. I didn't give you all the code.

However, I see your point (perhaps FF is more forgiving). I changed to spans, but there is another issue that I think I am finding that is actually crashing IE.

Error message:

Expected identifier, string or number Line 441

Line in question is the one that sets class in this block:

$(this).prev().attr(

{

src:"VSCheckBoxSelected.jpeg",

class:"checkBox"

});

It works in FF and Chrome, not IE.

I tried ending it with a comma and a semi-colon. Neither fixes it.

I am going to re-open ticket, although I know this to be a different subject matter (I want to be sure you get this). If needed, and we confirm a bug, I will be happy to open a ticket with this attr() issue as the subject matter.

Thanks. BTW: Do you know a source that lists which elements are block elements and which are in-line?

Changed October 30, 2009 12:04AM UTC by JeffMatthews comment:3

resolution: invalid
status: closedreopened

Changed October 30, 2009 12:22AM UTC by dmethvin comment:4

resolution: → invalid
status: reopenedclosed

The name "class" is a reserved word, so you can't use it as a bare word in an object definition. Either quote it or use className.

The W3.org site has a complete reference for all the different doctypes. There is a validator on the site so you can check your documents for correctness.

Definitely ask questions like this on the forums before opening (or reopening) a bug ticket. There are a lot more people who can help you there. If the general consensus is that you have really found a bug, then you can open a ticket here *with* a complete test case.

Changed October 30, 2009 12:29AM UTC by JeffMatthews comment:5

I just figured it out. Thanks so much for being there for us!