How to detect the user is accessing the site from mobile or from PC?

Hi guys, When developing a website we have take into consideration the different sizes of the screen. Now for mobile I have a created a sub domain with m.SITENAME.com. Now how to detect the user is using a mobile and redirect the user from the usual page to this page?

3rd Jun 2017, 2:39 AM
👍Challenge the W . O . L . F👈
👍Challenge the W . O . L . F👈 - avatar
1 Answer
+ 2
you can try using `navigator.userAgent` in Javascript to detect the navigator / device the user uses.
3rd Jun 2017, 2:44 AM
Vincent Martinez
Vincent Martinez - avatar