CancelImage Upload

How to find out what Operating Systems Platform your website visitors are using

Ever wanted to know how many of your visitors actually use Mac or Windows? Are you curious as to what percentage have actually ventured on to Linux? Then you will be interested in the code discussed on this page.

The code below will return the Operating System Platform on which an individual visitor is surfing your site. Note that since this code is JavaScript you will require a server side programming language through which to store this information. Ideally you will send the variable on through AJAX. Of course it can also be used to employ different site versions, or download areas that have a different set of requirements due to the operating systems.

var operatingSystem = navigator.platform;

If your user's operating system is windows vista for instance, the above code will return Win32. Here a more advanced example of how to load the current Operating System Platform into a span tag:

<html>
<head>
<title>How to find out what Operating Systems your website visitors are using</title>
<script language="JavaScript">

function getOperatingSystem()
{

          var operatingSystem = document.getElementById("operatingSystem");

          operatingSystem.innerHTML = navigator.platform;

}

</script>

</head>
<body onload="javascript:getOperatingSystem();">

<span id="operatingSystem"></span>

</body>
</html>


Login
Want to leave a comment?

No problem. Just enter your email and password below.


register | home | reminder

myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com