How to Detect Browser Name With JQuery

Total Post:67


 1778  View(s)
Rate this:
i'm want to Get Browser Name with help of JQuery
  1. 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


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.