Browsers sends us a string called the User Agent designation. A server can use that User Agent string to determine what browser is used to access the site, including the version and different features that it supports or not.
Using the User Agent information, we can define the name of the browser (Internet Explorer, FireFox, SeaMonkey, Chrome, Safari, Opera, various smart phones, etc.) and the version of the browser used. This information can in turn be used to determine which files to send to the browser to make it work better.
#if IE10 r = new FileReader; ... #else alert("FileReader not supported"); // support for FileReader in older versions is extensive ... #endif
This can be done in CSS files as well. That way we can avoid sending -moz-... options to IE or Chrome, for example.
Details about user agent strings: