I'm new here and I apologize if this question is basic/stupid. I am not too familiar with coding, so please excuse my ignorance/glaring errors. I have tried to put this together using code snippets found online and luckily I don't have to code too much for this project.
I am trying to automatically redirect users based on operating system and am really struggling making this happen. Here is the code I am trying to use...assume I know nothing!
<head>
<script type="text/javascript">
<!--
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
if( OSName == "Windows" )
{
window.location="http://www.driveweb.com/download-savvy-windows-free/";
}
else if ( OSName == "MacOS" )
{
window.location="http://www.driveweb.com/download-savvy-mac-free/";
}
else if ( OSName == "UNIX" )
{
window.location="http://www.driveweb.com/download-savvy-linux-free/";
}
else if ( OSName == "Linux )
{
window.location="http://www.driveweb.com/download-savvy-linux-free/";
}
else
{
window.location="http://driveweb.com/download-savvy-select/";
}
//-->
</script>
</head>
Thanks again, I sincerely appreciate the help!
Use user agent instead, because appVersion is deprecated.