This article will introduce the method of obtaining basic information of the device accessing the web page, and provide complete code and examples for everyone's convenience.
1. Get the visitor’s IP and location
javascript获取访问者IP及所在地
Output:
IP: 61.140.62.124地区代码: 440100所在地: 广东省广州市
2. Get the visitor’s device information
javascript获取访问者设备信息
Output:
userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:56.0) Gecko/20100101 Firefox/56.0appName: NetscapeappCodeName: MozillaappVersion: 5.0 (Macintosh)appMinorVersion: undefinedplatform: MacIntelcookieEnabled: trueonLine: trueuserLanguage: zh-CNmimeTypes.description: Shockwave FlashmimeTypes.type: application/x-shockwave-flash
This article explains how to obtain access device information through JS. For more related knowledge, please pay attention to the php Chinese website.
Related recommendations:
mysql5.7 export data prompt --secure-file-priv option problem solution
How to pass PHP implements the debug_backtrace method to track code calls
Explains the causes and solutions to the Warning: A non-numeric value encountered problem in PHP
The above is the detailed content of How to get access to device information through JS. For more information, please follow other related articles on the PHP Chinese website!