What’s got me worried is that IE NetRenderer will only load the page on IE7 if I remove that one <script> line. I’d give my left you-know-what for a pure-blood IE7 test.
I don’t think that I’m following you correctly. Where the client cannot do JS, you are using JS to load an alternative CSS file? I don’t think that is capable of working.
Link tags are not valid in the body of the page - they are only valid in the head of the page.
Conversely noscript tags are only valid in the body and not in the head.
A better solution is to have a stylesheet in the head that applies the styles you want for when JavaScript is not available and then use JavaScript to update the specific styles that need to be changed.
I changed the script to a more conventional approach, using document.write for the base.css and <noscript> for the no_js.css. It works fine for all browsers as long as the page is actually on the interrnet. If you do it locally it doesn’t work for IE. I don’t know why this should be so.
This script loads a black background when javascript is operating and a red background when javascript is disabled. I have included the CSS pages below the script here.
I have uploaded the pages to the internet for viewing. Try it with and without javascript enabled in all browsers.
I downloaded IETester and the page will refuse to load in any version of IE. It will remain a blank page, but if you “View Source” the entire code shows up. If I “wiggle” the page with using the Back and Forward buttons and smashing refresh it sometimes shows up, but obviously this is causing some major problems.
It’s clear that it’s that one line of inline JS in the HEAD section, but is the code itself faulty and inadvertently sending IE on an endless loop?