The tp framework development website has a PC version and a mobile version. how to automatically identify visitor devices? then, in different versions, my images seem to have a very short segment of Baidu code. but now I can find it again. don't go out. please tell us the simplest way. tp framework development websites have PC and mobile versions.
In my image, it seems that some very short Baidu code can be implemented, but now I can't find any more. please tell me the simplest way.
Reply content:
Tp framework development websites have PC and mobile versions. how can they automatically identify visitor devices and add them to different versions?
In my image, it seems that some very short Baidu code can be implemented, but now I can't find any more. please tell me the simplest way.
Navigator. userAgent. match (/AppleWebKit. * Mobile .*/)
Composer require mobiledetect/mobiledetectlib
Https://github.com/serbanghit...
Same answer: useragent
Github has
Mobile detect
You can also consider the self-adaptive css framework such as bootstrap.