Purists will tell you that it is extremely wicked to attempt to determine which browser/version you are using. The list is endless. The code keeps breaking. The code stops working as soon an a new version or new browser is released. However, if you to give the user instructions on how to use his browser, e.g. how to configure security, import a certificate, how to turn on Java, how to create a bookmark, you pretty well have to make a wild guess at the browser and OS (Operating System) . Further, if you are trying to collect stats on which browsers are most popular visiting your site and thus need extra testing, you need to detect the browser.
The most reliable source of this information in the user-agent field in the HTTP (Hypertext Transfer Protocol) header. Your server has access to this field, but not CSS (Cascading Style Sheets) or HTML (Hypertext Markup Language).
Conditional-CSS requires you to install code your server than generates custom CSS depending or which browser each client is using. You write a unified CSS style sheet with conditionals in it that mark certain rules and only applying to certain browsers. It discovers the browser from the user-agent field in the HTTP header.
Microsoft discontinued support for conditional comments in version 10. Prior to that you could put magic comments in your code that most browsers would ignore, but that only IE could see and render. The net is full of obsolete advice on using this feature.
E.g. for IE users, I want to display:
For non-IE users I want to display:
I found this piece of code which looked like 90% of the solution:
Here is the solution:
First load the detectIE function.
Then generate either of the two alternate wordings.
I would hope there is a more elegant way of doing that is that does not mangle the wordings, but at least this works.
This page is posted
Optional Replicator mirror
Your face IP:[184.108.40.206]
You are visitor number|