Freigeben über


Show IE version-specific content sample

This page detects your Internet Explorer version via navigator.userAgent and then hides the content that does not apply to your version. When parsing the userAgent, it looks for "MSIE 5", "MSIE 6", "MSIE 7", or "Trident 4" (Trident 4 is IE8, which sends "MSIE 8" in Standards mode and "MSIE 7" in Compatibility Mode). This page using inline JavaScript. The sample (attached) includes .js files and a separate content .htm file. Thanks to Jeremy for providing the sample and helping me tweak it to work with IE8.

The results of the detection are displayed below:

We identified that you are using:
Browser: Internet Explorer 5
We identified that you are using:
Browser: Internet Explorer 6
We identified that you are using:
Browser: Internet Explorer 7
We identified that you are using:
Browser: Internet Explorer 8
We could not identify your browser version:
Browser: Unknown

pcTemplatePageScripts.zip