IE8 claims my page has an error, firefox doesn't, and I can't find any error. Help!

Posted by Bears will eat you on Stack Overflow See other posts from Stack Overflow or by Bears will eat you
Published on 2009-08-13T20:16:47Z Indexed on 2010/04/22 3:23 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

This is something of a follow-up question to my question here. You can find the HTML source in a text file here.

When I load that page in IE8, I get the "Done, but with errors on page." message in my status bar. The detail view shows

Expected identifier
sms                                                  Line: 147
Code: 0                                              Char: 67

and I see absolutely no problems anywhere near there. In IE8, the page is still behaving erratically w/r/t the randomly losing focus as mentioned in my other question.

When I load the same exact page in Firefox (using Firebug) the console shows no errors and the page works perfectly. Any thoughts on what's going on here? This is driving me nuts and making me want to give up on even trying to write an IE friendly page.

Edit: Thanks for all the comments! This page is written as a JSP, so I edit in Eclipse. I found an Eclipse warning about the onblur event for the username field. I switched it from

onblur="alert(document.activeElement + ' class:' + document.activeElement.class)"

to

onblur="alert(document.activeElement)"

and that made the bizarre IE page error vanish. I had been trying to give more info (namely, its CSS class) about specifically which element is stealing focus - to my own detriment, apparently, since Javascript was interpreting the '.class' part in the Java(script) sense.

And, no, the page doesn't validate. But the errors were mostly/all ones that just didn't make sense, such as

Line 14, Column 41: Attribute "LANGUAGE" is not a valid attribute. Did you mean "language"?

to which I say, WTF?!

But I'm still stuck trying to figure out why, as I enter text in the username & password fields, focus randomly switches to a div (working on figuring out which div currently).

Edit 2: It's the div between the two "global nav" comments, at the very top of the body. Still no idea why it's happening, though.

© Stack Overflow or respective owner

Related posts about ie8

Related posts about error