How to detect mobile device and get user agent info send and save that information to database on server, only once?

后端 未结 3 1736
不思量自难忘°
不思量自难忘° 2020-12-13 22:38

Is there any script to check user agent then send and save that information to database on server?

I\'m making mobile website with 2 versions like m.facebook.com

3条回答
  •  攒了一身酷
    2020-12-13 23:06

    You might want to look into jQuery's take on this, since it's interesting.

    In addition to detecting the browser, they detect browser features:

    http://api.jquery.com/jQuery.browser/

    http://api.jquery.com/jQuery.support/

    Also, keep in mind that some mobile users don't want to be redirected to the mobile-optimized device. I, for one, positively hate it when a site detects my iPad as a mobile device and sends me (without any possibility to override it) to a sloppy mobile site that I wouldn't even want to browse with an iPhone.

    iOS and Android devices, in general, will happily work with the standard site if it's coded properly. And other mobile phones are quickly dying.

提交回复
热议问题