I am developing an interactive Javascript-driven tool that does not support IE6 or IE7.
If someone appears using old IE or using a browser with Javascript disabled, we provide them with simple static content as a backup: simple images and text.
I could just do this by duplicating this static content, one copy in the <noscript> block and one copy in the conditional comment, like this ...
<noscript><![if !(lte IE 7)]> <div id="some-id"> <p> Some content </p> <img src="url.com" alt="Screenshot of awesome tool" title="This is what you're missing" /> <p> Some more content </p> <div id="some-more"> ... etc ... </div> </div> <![endif]></noscript>
... but, if possible, it is better to avoid duplication of content like this. There is no excess weight, itβs easier to update, there is no risk for any search engine robot that interprets hidden duplicate content as spamming keywords, etc. Plus, avoiding duplication is just a good practice.
(Also, we could lose the terrible <![if !(lte IE7)]> in the <noscript> ... it is there if someone has IE6 or IE7 with Javascript disabled, so they don't see the content twice ... I heard about some enterprise systems that have legacy systems tied to older versions of IE, making this a terrible way to make old IE a bit more secure ...)
If I wrap conditional content in <noscript> , or vice versa, it will be the logic βANDβ - it is displayed only if both conditions are met (IE6 / 7 with Javascript disabled).
Is there a way to make it work with OR logic, so there is one block of content and one block of content is displayed if there is no Javascript, or if IE is less than version 7? Or is there some smart, simple, reliable way to use Javascript to switch <noscript> to if the browser is turned on Javascript and is an old version of IE (ideally, without waiting for the document to be ready)?
Since I already use conditional comments, strict adherence to standards is not a big deal, for example. if a script was involved in the <noscript> tag attribute, that would be nice. The jQuery syntax is great too.
A simple, clean way to offer one block of fallback content for older IE or noscript browsers would be a very useful thing.