Untitled


SUBMITTED BY: Guest

DATE: June 6, 2013, 2:35 p.m.

FORMAT: Text only

SIZE: 912 Bytes

HITS: 1154

  1. <head><title></title>
  2. <script>
  3. function getOS() {
  4. // This script sets OSName variable as follows:
  5. // "Windows" for all versions of Windows
  6. // "MacOS" for all versions of Macintosh OS
  7. // "Linux" for all versions of Linux
  8. // "UNIX" for all other UNIX flavors
  9. // "Unknown OS" indicates failure to detect the OS
  10. var OSName = "Unknown OS";
  11. if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
  12. if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
  13. if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
  14. if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";
  15. alert("Your OS is " + OSName);
  16. }
  17. </script>
  18. </head>
  19. <body onload="getOS();">
  20. </body>

comments powered by Disqus