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

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.

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?

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.

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.

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

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

Related

Chrome crashes when try to use spell checker to correct the spelling of words in a Vaadin text field

When I try to use Google Chrome's spell checker to correct the spelling of words in a text field or text area, Chrome crashes and displays the “Aw, Snap!” error message. This issue is only present on Chrome.
This is the sample code for reproducing the issue.
As soon as I right click on the red underlined word, Chrome crashes and it displays the error page. If there are multiple misspelled words in text field, only the last word causing an issue. I don’t have any issue with using spell checker for other words expect the last one, “mssage” in this case. I also don’t have any issue when there is another correctly spelled word after the misspelled word. In this case, it doesn’t crash.
In general, what I observed is that if the misspelled word is the last word in the text field, then the crash occurs; otherwise, it works as expected. I have checked all log files including Chrome local logs, but there is no log message related to this issue, and I am not able to debug it. I found a few partial solutions, but still couldn’t understand the root cause of this issue.
Partial solution-1: If we remove the text from the Button, the issue is resolved. As you can see, the button doesn’t have any text written on it, and in this case, it works as expected.
Partial solution-2: If we swap the order of the Button and Text Field, the issue is resolved. When I add components to the layout, the order makes a difference. When the button is added before the text field, the issue isn't there.
Partial solution-3: This is the solution I am currently using since the first 2 solutions require me to change my layout. If I add the suffix (sample code included) to the text field, the issue is resolved; however, the suffix has to have text in it, otherwise it doesn’t solve the issue. I added Label with “.” and set opacity to “0” to make it invisible on the user end.
Thank you so much.
I was able to reproduce your issue in Chrome Version 91.0.4472.114 in macOS and it works after upgrading to Version 92.0.4515.107.
It was already reported in bugs.chromium.org and it's fixed in latest Chrome.

Chrome parses the url incorrectly

This is how I am adding image tag under div
<img src='/files/images/remove.gif' border='0' " +
" onClick='function(\"" + url + "\");' />";
When I open my page in Firefox, everything works fine and here the HTML gets generated in FF
<div class="myclass"><img border="0" onclick="myfunction("http://127.0.0.1:8080/abc/attachments/1d28bc6b-f637-426f-8bca-e27f1c6f2ed9/debug.txt");" src="/files/images/remove.gif">
</div>
But in Chrome HTML gets generated like this
<div class="myclass"><img src="/files/images/remove.gif" border="0" onclick="myfunction(" http:="" 127.0.0.1:8080="" abc="" attachments="" 1d28bc6b-f637-426f-8bca-e27f1c6f2ed9="" debug.txt");"="">
</div>
See the url it add extra quotes and = sign.
Can anyone please help me to understand what's wrong here, any workaround/solution for this problem?
Thanks.
Well, at first, it looks like a bug in your script that emits the contents of the onclick. But then, it'd show up also in other browsers..
However, let's try from this view and assume it is a bug in your code, not Chrome.
Is the onclick generated by JS code, or on the server? If on JS, then please show us the code that generated and set that onclick handler, just to be sure it is correct.
OTOH, if it is generated on the server (ie. PHP, ASP, Ruby, ..), then have you tried peeking what exactly is sent over the wire? Open Chrome's DeveloperTools, go to "network" and refresh the page. Then watch the 'responses' and check if the HTML code embedded in them is correct. If it is incorrect, then look for a bug in the serverside scripts. If HTML seen in responses is correct, then indeed it is the browser.
If this is the latter case - the fact that HTMLInspector shows you the tag/link as damaged, it does not mean it has to malfunction. The Inspector is only a software too, so it may have some bugs in parsing/displaying - but the HTML tag may be correct and work properly. I've seen similar mis-displays a couple of times with various URLs before, but the links always worked properly. Try opening the ChromeConsole and $jquerying the URL out of that onclick. It might happen that you'll get the correct result - in that case, that's just presentation bug and the click/link should work properly - so ignore it or report to Google as a bug. Were the obtained URL incorrect, I'd double- or triplecheck the HTML in Network/Response to ensure that it really really as properly formatted, and then I'd call it a bug and try to work it around - i.e. by setting it via JS in onload, etc..
You are using some server infrastructure in between that is not pure HTML or JS, so we can't help properly. You have onClick (looks like .net), +" " + in the middle, which is not pure HTML.
I created a replication here: http://jsbin.com/ubacak/latest Note, I changed your code and just had it as pure js + html and all is fine.

How to resolve chrome frameset target attribute issue

I'm using html frameset in one of my page. where i've divided that frameset to 3 frames. Like..
TitleFrame
LeftColFrame
RightColFrame
In my 'LeftColFrame' frame i've couple of links which has target attribute value as 'RightColFrame '. Every things are going fine except when i click any links from 'LeftColFrame ' it's opening the content in a new browser tab rather than opening in 'RightColFrame'.
Don't know what's going wrong. After googling , i got to know Chrome has some issue with Frameset. But, didn't got real solution to avoid this thing.
So, if any body have any idea about this plz share with me.
Regards
Holly Shit!!!
Guys, after 4hr of extensive debugging now i got the cause for which all these crap was happening. The thing is... in one of my javascript file i've used a variable by name as 'name'. Like this..
var name = false;
And, this 'name' was creating problem in webkit page rendering engine which used by both Google Chrome & Safari. After, googling a bit i got to know that 'name' is a reserve keyword in JavaScript. But,even if this.. IE & Mozilla have no issue with it. But, webkit has some issue.

Inputs print without text inside them, but are visible on the screen

I have a problem with a project that I have been working on for a while now. When I open an entry, the inputs all have data in them. However when I go to actually print the entry (using the print-mode, CTRL+P), I notice that the select, and textarea fields are missing the selected or input text on paper. What's going on here? I have googled for hours and can't come up with anything relevant... help! Thanks!
Link to Project (Click "Demo" to create a session - required)
Link to Entry (Click this after you click the 1st link)
Update : Before now I have just been using Google Chrome to test printing. However, when I tried FireFox, it printed alright, is there anything special I need to do to get Chrome to work??...
RESOLUTION : I am using jQuery and I found that by removing the ui-corner-all class from the inputs before printing, I could then print. Thanks anyways!
If you're using Internet Explorer, then this discussion thread may help you (summary: IE can get confused when printing malformed docs). Check your doctype tag matches your output (the w3c markup validator is very useful)
Edit - I see you're using chrome, but I suggest you still check your page is well formed :)
RESOLUTION: I'm using jQuery and I found that by removing the ui-corner-all class from the inputs before printing, I could then print. Thanks anyways!

IE printing out source code at random (seems very nondeterministic)

Hey. the busted website is: www.mgxvideo.com/mgxcopy-alpha-3, and the specific error that I'm getting is the thing where IE prints out all my source code.
As far as I can tell, the error is appearing at random in IE6, 7, and 8, but it's a commonly occuring error. I'm looking for explanations, debugging tools, fixes. Anything is appreciated, because I'm fully stuck.
Here's how to reproduce:
Add item(s) into cart.
At the display cart (the url shud end with cart_display_ie.php)
Use the shipping calculator over and over and over again until you get the error. It's happened one the first, second, 5th, and the 17th try.
Reset cookies to restart from fresh
Here are some possibly relevant details
1and1 hosting, php from scratch, and mysql
I'm using Mark Sanborn's php code to interface with UPS's servers.
I'm using a local DTD for xhtml transitional 1.0
This error also appears in the checkout cart and also seems associated with the UPS function.
This isn't directly relevant, but IE also plagues me with "The XML page cannot be displayed."
Occassionally, the "The XML page cannot be displayed" is displayed as a small canvas within the context of a source print like the error I'm printing. It'll appear near the location of the error in html source, except the canvas has a really small width and height, and not display any further source code afterwards. I've fixed all these errors; they were all caused by improper syntax or w3 rationing of DTD downloads.
The cart_display*.php is responsible for adding products, removing products, and calculating shipping.
Sometimes it's something stupid like custom settings on my computer b/c I tweak with random settings that cause side effects. But I've tested in msft's VirtualPC, and had friends reproduce the error.
Here are some resources of similar problems. I haven't tried them because--even if they work--they mean that the website doesn't work at typical/default settings.
http://www.techsupportforum.com/microsoft-support/internet-explorer-forum/168285-ie7-problem-printing-html-xml-source-rendering.html
http://www.computing.net/answers/windows-xp/ie6-printing-problem/160128.html
Like I said: any explanations, tools, guesses, or fixes are fully appreciated. I'm trying to finalize the site so I can present it as a beta within the week, and I'm fully stuck. Also, is there a workaround (like a tag) that can hide this error from the user?
I grabbed a network capture of the repro using Fiddler (www.fiddler2.com).
It looks like you're sending an HTML comment containing a webservice result before the HTML body. It further looks like IE is subsequently sniffing this as an XML body instead of a HTML response.
It appears that if you move your HTML comment inside your HTML tag, the problem goes away.
Note that you should confirm changes in a new browser tab. Once IE is on an XML page, simply hitting F5/Refresh isn't necessarily going to show you the HTML content properly due to caching of the MIME-type decision.
To resolve this issue, you need to re-register two dlls.
Open a elevated command prompt and type following commands
regsvr32 /i mshtml.dll
regsvr32 /i shdocvw.dll
For detailed fix steps, visit http://geekzsupport.com/internet-explorer-prints-html-source-code/