0

I have this code to redirect based on platform. Is there a way to be even more specific on the Macintosh? I need to set URLS by OS version, 10.5, 10.6, 10.7, etc.

<script language="JavaScript">
if (navigator.userAgent.indexOf("iPhone")!=-1) window.location = "http://example.com/ios.html";
if (navigator.userAgent.indexOf("Windows NT 6.1")!=-1) window.location = "http://example.com/windows7.html";
if (navigator.userAgent.indexOf("Windows NT 5.1")!=-1) window.location = "http://example.com/windowsxp.html";
if (navigator.userAgent.indexOf("Macintosh")!=-1) window.location = "http://example.com/macos.html";
if (navigator.userAgent.indexOf("Linux")!=-1) window.location = "http://example.com/linux.html";
</script>
JeffreyLazo
  • 813
  • 4
  • 13
  • 17
  • possible duplicate of [How to Detect Mac OS X Version in JavaScript](http://stackoverflow.com/questions/12451382/how-to-detect-mac-os-x-version-in-javascript) – Derek 朕會功夫 Jan 18 '14 at 00:43
  • If this is to find out what the browser supports then you're better off doing [feature detection](https://api.jquery.com/jQuery.support/) instead. – Jivings Jan 18 '14 at 00:43

0 Answers0