views:

1685

answers:

6

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 there is no class property (I should have been using className).

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

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

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.

+1  A: 

Does your HTML validate?

I agree, IE does a terrible job giving developers information about page errors. I only support IE on the principle that users shouldn't have to download twenty-odd browsers to go to their favorite websites. Web developers have a responsibility to make it "just work". Browser developers have a responsibility to communicate with each other and conform to standards.

mcandre
A: 

Run your javascript through JSLint. You probably have a missing semicolon somewhere or a comma at the end of an object property that shouldn't be there. Firefox is more forgiving than IE when it comes to those types of syntax errors.

Edit: The inline js in your page seems to be OK. Check the contents of qm_scripts.js.

ifwdev
A: 

When I remove the .class from document.activeElement.class the error goes away.

Rob
+2  A: 

The problem appears to be the line

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

when you take off the ".class" it loads without issue. Are you sure ".class" is valid?

Tom
A: 

The real issue is that you need to be able to debug your JS in IE 8, correct? There is a tool for that! :)

Nelson
Not really. I know about using IE's dev tools.
Matt Ball
A: 

I meet the same quest as yours, i think it's a bug of IE 8 because it works perfect on IE 6 & 7. The quest seems has relations with the event "onblur".Event i tryed "onblur="alert("What's the fucking problem here!")" ", it still reports error!!! If some guy has a answer , please emails me.

War701
Is the event you're trying exactly as you typed above? You can't use all double quotes like that. At the very least, use this: `onblur="alert('WTF')"`. Note the lack of the outermost quotes.
Matt Ball