1

I have a bug in which a user which views my web application using IE8 hits F5 (refresh) and from time to time, the paged is rendered incorrectly.

I was able to reproduce it on my dev machine and using IE developer tools I was able to find out that the document mode became Quirks. When I changed the value to "Internet Explorer 8 Standards (Page Default)" the problem is resolved and the layout is back to normal.

Some technical info:

  1. Normally, the page is loaded as "Internet Explorer 8 Standards (Page Default)".
  2. My doctype is: <!DOCTYPE html>
  3. I have the following meta tag: <meta http-equiv="X-UA-Compatible" content="IE=edge">
  4. The meta tag is the very first element in the "head" element (since some posts suggested that it should be before any other elements, even before the "title" element.

Snippet of my html "head" element

I'll appreciate your help :)

Edit: I also tried to uncheck the “display all intranet sites in compatibility mode" checkbox.

nadavy
  • 1,755
  • 1
  • 18
  • 33
  • 1
    Is the DOCTYPE declaration the very first thing in the page? is there any white space before it? any type of content? Found this page https://alastairc.ac/testing/IE_Doctypes/ its really weird, as long as the doctype is in HTML5, IE should go to default mode. – António Regadas Dec 30 '14 at 14:22
  • Its the very first declaration. I have some white spaces but note that it happen after a page refresh (I just hit F5 few times in a row). – nadavy Dec 30 '14 at 14:26
  • Stop supporting IE8 and tell them to upgrade. – Waxi Dec 30 '14 at 14:28
  • Why do you have a ID in the tag? Remove that and also those T&T .. stuff from the . – António Regadas Dec 30 '14 at 14:28
  • your `` tag seems in after `` and `` tag put it after `` ..or read here more ..http://stackoverflow.com/questions/6156639/x-ua-compatible-is-set-to-ie-edge-but-it-still-doesnt-stop-compatibility-mode – Anant Dabhi Dec 30 '14 at 14:30
  • 1
    @slime - can't. we have an enterprise client which requires it. This was one of their requirements.. – nadavy Dec 30 '14 at 14:30
  • @António Regadas - still no good. Removed them both and the issue continues. – nadavy Dec 30 '14 at 14:34
  • Can you share the URL so i can run it too in a IE8 VM? – António Regadas Dec 30 '14 at 14:38
  • I'm gonna say that the compatibility mode setting in IE is causing your problems. Try turning it off and seeing if it does anything. – Waxi Dec 30 '14 at 14:40
  • @António Regadas - sorry. I can't due to legal constraints :( – nadavy Dec 30 '14 at 14:44
  • Notice any changes if you change the doctype to html4? – António Regadas Dec 30 '14 at 14:45
  • @slime - tried that also. – nadavy Dec 30 '14 at 14:47
  • Move the meta tag so it comes after the title. Some users have reported that being the fix to this problem. – Waxi Dec 30 '14 at 14:52
  • @António Regadas - still, no luck. – nadavy Dec 30 '14 at 14:52
  • @slime - no luck. Moving right after the title didn't help. – nadavy Dec 30 '14 at 14:54
  • Its strange the fact that it only happens when you refresh the page... does it only triggers quirks mode in IE8? Is 9 ok? clearing the browser cache doesn't help? – António Regadas Dec 30 '14 at 14:56
  • @António Regadas: 1. Clearing the cache doesn't work. 2. I don't have IE9 machine. I can load a VM but it will take me a day. I've tried on IE10 but it doesn't reproduce. – nadavy Dec 30 '14 at 15:08
  • @nadavy Can you reduce your page to a degree that your legal constraints are no longer an issue, and the issue is still reproducible? – Sampson Dec 30 '14 at 15:36
  • Why did you upload an image of your code? Just copy/paste the code right into your question. I can barely read that, and if I wanted to try your code on my own machine I don't have anything to copy/paste from. – Phil Tune Dec 30 '14 at 17:13

1 Answers1

0

After a research, I saw that this issue is reproduced in a simple HTML page ("Hello World" style). Further research reveled that our IE8 virtual machine template was infected by adware which injected a script to the page, which in turn modified the DOM.

The issue was resolved as soon as I've cleaned the adware.

nadavy
  • 1,755
  • 1
  • 18
  • 33