Detect in browser
<script>
document.write (Navigator.userAgent.toLowerCase ());
</script>
Output to
mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;. NET CLR trident/4.0; inf opath.2; asktbptv/5.17.0.25589; Alexa toolbar)
Detect display as
mozilla/5.0 (Windows NT 5.1; rv:38.0) gecko/20100101 firefox/38.0
in FF browser
Displays
mozilla/5.0 (Windows NT 5.1) applewebkit/537.36 (khtml, like Gecko) in Google browser chrome/42.0.2311.152 safari/537.36
Why doesn't identify yourself? This is a little weird. The specific reason may be a business relationship, according to the above we know that different browsers will bring their own browser firefox/38.0 chrome/42.0.2311.152 so we can use this to determine the user browser type.
<="" pead>="" body>="" <script type="Text/javascript" >="" var useragent="Navigator.userAgent.toLowerCase" (), s, o =" {}; " var ="" (useragent.match="" (="" ?:="" firefox|opera|safari|="" chrome|msie)="" [\="" : ]="" ([\d.]="" +)="" )="" [1],="" safari:="" version.+safari="" .test="" (useragent),="" ="" chrome:="" chrome="" ="" firefox:="" firefox="" ie:="" msie="" useragent),="" opera: ="" opera="" (useragent )="" ="" } ="" * ="" get="" name="" and="" version="" information="" *="" if ="" (browser.ie && browser.version > 6)="" { ="" *="" to="" determine="" if="" the="" above="" is="" ie 6,="" perform="" following="" operations="" document.writeln="" ("<p>="" you="" are="" using="" ie ="" "+browser.version+"="" <\="" p>="" ");=""  }="" script>="" ptml><="" pre="">
You probably know what's going on with the comments in the code above. Note: The Browser.version > 6 version in if can only be used for IE, the other browser version can not be so judged, there is no way to find a solution. If you want to make the If judgment successful and execute a section of HTML code, then you can fill in the {} after if the HTML converted to JS code. Here are a few typical browser judgment statements:
if (Browser.safari) {}/* Determines whether safari/
if (Browser.firefox) {}/* is judged to be Firefox
/if (browser.chrome) {}/* Whether it is for the chrome/
if (Browser.opera) {}/* to determine whether the opera
/if (browser.ie) {}/* is for IE */