Jump to content

Ie Quirks Mode


LSW

Recommended Posts

So, I have done next to no web design in 4 years so I am no doubt rusty.

 

I have an ASP classic application I am finishing up Look & Feel changes to. Most was already done and I just had to redesign 1 page and it looks fine.

 

My issue is that the entry page (Look & Feel done by someone else) is off. The footer is centered, but the header, nav, breadcrumbs and content is all shifted Left IE (Fine in all other browsers). The real bugger is that only the entrance page is off center in IE, all other pages are centered, including the only page I had to re-skin. I have copied pver and replaced all the HTML common between the two pages, no help.

 

Using the IE web tools I have found that the entry page is opening in Quirks Mode, my page is opening in IE9 Standards Mode. My page in IE Quirks mode switches left and the entry page in Standards mode shifts to centered.

 

I restart IE (No cache, set to get new web page each time) and again the entry page was quirks mode and my page was standards mode.

 

Like I said I replaced all the HTML header and structure with that of my page including CSS links and Doctype. Everything but the content and ASP code are the same.

 

So if not the Doctype, what else can throw IE into quirks mode for just one single page? Any ideas?

Link to comment
Share on other sites

For the longest time I did not post here about this. Now I post and THEN it gets solved. So I am closing this for comments but will leave it for others in the future.

 

I kept going back and forth with our web master and the term javascript kept coming up. He thinks as a web developer and I think as a programmer. So I go into the raw code and see no JS inside the asp code and he keeps suggesting that the JS outside of the HTML may cause quirks mode. He finally sent a screen shot of the source code... the "delivered to the browser source code" which I never thought of, I was looking at the complete code package as a programmer.

 

His screen shot showed far to much JS for me to overlook and that is when it hit me and rechecked the code to find an include calling for a asp page to be included at that spot that turned out to be an asp page with just one JS function. The result was a JS function being inserted out side of the HTML and even before the Doctype. I moved the include into the HTML Header tags and all is well, standards mode and page centered.

 

LESSON:

  • Always keep JS in the HTML.
  • Best to use JS includes as *.js or maybe even *.inc, but not as *.asp (or *.php etc.), had I seen the include as <!-- #Include file="JSVerify.js" --> then it would have stuck out and the issue solved earlier. But instead it was <!-- #Include file="JSVerify.asp" --> and the page is riddled with asp includes which are just fine outside of the HTML.
  • Remember what makes sense to you may not to others after you. There is technically nothing wrong with it being as asp page and the author knew it was there, but now years later it was not clear that is was JS and outside of the HTML code. For clarity down the line it should have been a JS file.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...