I'm having an issue where all versions of IE are rendering a single page on my site in Quirks mode. This page is opened in a new window by clicking a link:
<a href="javascript:void(0);" onclick="popUp();" target="popupWindow">Launch Processor</a>
And the window is determined using the following js:
function popUp(contactId) {
"use strict";
var url, width, height, leftPos, topPos, targetWin;
url = '/company/process';
if (contactId !== undefined && contactId !== null && contactId > 0) {
url += '?contact_id=' + contactId;
}
width = 900;
height = 800;
leftPos = (screen.width / 2) - (width / 2);
topPos = (screen.height / 2) - (height / 2);
targetWin = window.open(url, 'popupWindow', 'toolbar=no, location=0, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + topPos + ', left=' + leftPos).focus();
}
Now, after a ton of research I have tried everything and read various other questions asked here documenting the same issue, like this one and this one.
I've checked my file in my text editor, and viewing the source in IE and Chrome (not using the Inspector tools or Developer Tools in IE) and there are no spaces, characters or other things that may interfere before the doctype. Viewing the doctype in IE developer tools though I see it is commented out. This is the same doctype structure (from HTML5 Boilerplate) I use site-wide. No other pages have this issue. The doctype declaration and meta items are below:
<!doctype html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 page-company" lang="en"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 page-company" lang="en"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9 page-company" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js page-company" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Now, like I mentioned this page is loaded in a new window that is opened using some js. If I right-click the window, and select refresh, the page rights itself, doctype is no longer commented out and the page is rendered correctly in Standards mode, not Quirks. If I access this url directly, and not through the new popup window, it also renders correctly.
What could cause this? Is this something to do with the js used to force the new window to open?
Thanks in advance for any and all help, I'd really appreciate it!