Skip to content

Instantly share code, notes, and snippets.

@goldalworming
Created July 2, 2014 16:07
Show Gist options
  • Save goldalworming/c2397d16ae002c512531 to your computer and use it in GitHub Desktop.
Save goldalworming/c2397d16ae002c512531 to your computer and use it in GitHub Desktop.
detect mobile in total.js
var regMobile = /iPad|iPhone|iPod|Android/g;
if (regMobile.test(controller.req.headers['user-agent']))
console.log('Is mobile device');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment