Is there a way for a website to determine if it is being viewed on the iPad, and if it is being browsed, and iPhone / Android / Pre

I want to create a website that can be visited by browser type, and when a user visits the site on different devices (iPad, iPhone, Netbook, PC), they immediately see the version of the site optimized for them, instead you need to go to m.example. com. I know that you can specify html for printing, etc. Is there a type for sizes and types of devices (multitouch versus mouse)?

+3
source share
2 answers

, - USER_AGENT, . , , . , , , , google 'useragent'.

, HTML-, / JavaScript .

!

+6
use CGI::Info;

my $info = CGI::Info->new();

if($info->is_mobile()) {
......
}
0

Source: https://habr.com/ru/post/1765901/


All Articles