Home > DeveloperSection > Forums > How to Get OS Name With JQuery
ben reitman
ben reitman

Total Post:96

Posted on    September-22-2014 4:33 AM

 JQuery JavaScript  JQuery 

 1 Reply(s)
 1047  View(s)
Rate this:
I am working on a website and i'm want to get OS Name our website open on which OS.

Kamlakar Singh
Kamlakar Singh

Total Post:194

Posted on    September-22-2014 4:35 AM

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>

    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);

i think this post solve your problem

Don't want to miss updates? Please click the below button!

Follow MindStick