How to Detect Browser Name With JQuery

Total Post:67

 1521  View(s)
Rate this:
i'm want to Get Browser Name with help of JQuery
  1. Post:194

    Re: How to Detect Browser Name With JQuery

    Hi Alex Leblois i'm try to get browser name with JQuery i think Helpful for you

    Here is my Html Code:

    <h2 id="browsernmae"></h2>
    Here is Jquery Code:
    <script src="~/script/jquery-2.1.0.min.js"></script>
        jQuery(document).ready(function () {
            var browserName = navigator.appName;
            var nAgt = navigator.userAgent;
            if ((verOffset = nAgt.indexOf("Chrome")) != -1) browserName = "Chrome";
            else if ((verOffset = nAgt.indexOf("MSIE")) != -1) browserName = "Microsoft Internet Explorer";
            else if ((verOffset = nAgt.indexOf("Safari")) != -1) browserName = "Safari";
            else if ((verOffset = nAgt.indexOf("Firefox")) != -1) browserName = "Firefox";
            var opera = (navigator.userAgent.match(/Opera|OPR\//) ? true : false);
            if (opera == true)browserName = "Opera";
            $("#browsernmae").html("Browser Type = " + browserName);

      Modified On Apr-05-2018 06:02:06 AM



Enter your email address here always to be updated. We promise not to spam!