What's the best way to detect whether the client is a tablet or a phone?

后端 未结 4 1655
有刺的猬
有刺的猬 2021-01-22 20:24

I am currently developing a client side application which will be designed for both, smartphones and tablets. Therefore it will get two different layout modes.

While th

4条回答
  •  一向
    一向 (楼主)
    2021-01-22 20:54

    I would go with detecting the screen resolution, as it should not really matter if the browser is a phone or tablet, the only thing that should affect is the layout. And the best thing to determine which sized layout to use, would be the resolution.

提交回复
热议问题