title: Detect via JavaScript if mobile operating system is used by the users device
body: <p>In addition to the Viewport-Size (viewportSize.js) and the Device-Size (getDevicePixelWidth.js) I have to know if the user device is a mobile or a desktop operating system. For expl. I have to differ between a table with android or other mobile os and windows 8 or Linux desktop os and android or MacOS and iOS and so on.
  Yesterday I googled a lot and read many statements, so I'm confused, cause some say, I should use: (<a href="https://stackoverflow.com/questions/11108409/detect-mobile-operating-systems-via-javascript">navigator.appVersion or navigator.userAgent</a> other say that aint good progr. practice.
  I need a lightweight reliable solution. Does anyone know?</p>