Created
September 23, 2016 04:41
-
-
Save devheedoo/1ea58ff4b6912dc67cee788bddf98928 to your computer and use it in GitHub Desktop.
Check user's agent is mobile or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UserAgent = navigator.userAgent; | |
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) { | |
location.href = "/mobile/index.html"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment