1

I'm developing a google gadget which needs to display one way if it is being viewed on a mobile/smartphone operating system (e.g. Android, iPhone, or any device that uses a mobile iGoogle page). But I only want it to display that way if the operating system is using mobile iGoogle.

I simply need JavaScript code to detect the operating system (if this can be done from within a google gadget). I've done a bit of research, but none of the codes are very simple.

Does anybody have ideas or suggestions?

zdebruine
  • 3,687
  • 6
  • 31
  • 50

1 Answers1

1

You can find out what OS you are on by using the following:

navigator.appVersion or navigator.userAgent

Rishav Rastogi
  • 15,484
  • 3
  • 42
  • 47