Skip to content

Instantly share code, notes, and snippets.

@kamenov
Created August 28, 2012 06:41
Show Gist options
  • Save kamenov/3495591 to your computer and use it in GitHub Desktop.
Save kamenov/3495591 to your computer and use it in GitHub Desktop.
How to detec mobile devices on your site :)
<head >
<script type="text/javascript">// <![CDATA[
var mobile = (/iphone|ipad|ipod|iemobile|android|blackberry|mini|symbian|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) {
document.location = "http://vivacom.bg/m";
}
// ]]></script>
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment