such as the title: now many tablets also use Windows10,. I want to check whether users are using tablets or PC computers, and ask for advice on PHP, Node and JS.
such as the title: now many tablets also use Windows10,. I want to check whether users are using tablets or PC computers, and ask for advice on PHP, Node and JS.
JS: navigator.userAgent
you press F12 to enter navigator.userAgent directly in the console. My computer will display a string with Windows, and a mobile phone will display a string with Android.
my two pictures here are all the information of navigator.
let list = [];
for (let o in navigator) {
list.push(<div>{o + '=' + navigator[o]}</div>);
}
return (
<div>{list}</div>
);
the simplest way is to judge
if ((navigator.userAgent.match (/ (phone | pad | pod | iPhone | iPod | ios | iPad | Android | Mobile | IEMobile | MQQBrowser | JUC | Fennec | wOSBrowser | BrowserNG | WebOS | Symbian | Windows Phone) / I) {
alert ('mobile end')
} else {
alert ('PC side')
}
Useragent analysis tool. Browser Analysis and judgment tool-user Agent, operating system Information
Code address: https://github.com/mumuy/browser
problem description Mini Program uses canvas to display the generated QR code picture, but the computer shows that the mobile phone report indexof is undefined??. the environmental background of the problems and what methods you have tried there i...
what I want to ask is. Now the background is to exchange three parameters for the user s encrypted token. one is code obtained through wx.login and the other two are iv and encryptedData obtained through wx.getUserInfo. Here comes the problem of thr...