HOW TO GET OS NAME WITH JQUERY

ben reitman

Total Post:96

Points:676
Posted by  ben reitman
 1074  View(s)
Ratings:
Rate this:
I am working on a website and i'm want to get OS Name our website open on which OS.
  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How to Get OS Name With JQuery

    Hi Ben

    you can do this easily with JQUery
    Write Html Code :

    <h2 id="browsernmae"></h2>

    JQuery Code :

    <script src="~/script/jquery-2.1.0.min.js"></script>

    <script>
        jQuery(document).ready(function () {

            var OSName = "Unknown OS";
            
            if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
            else if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
            else if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
            else if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";

            $("#osname").html("Operating System:  " + OSName);
        });
    </script>

    i think this post solve your problem

Answer

NEWSLETTER

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