Today to do mobile web, in the post-processing time, found a lot of problems. Let me enumerate the following separately ~ ~
1. There are many mobile browsers, the display of various browsers and so on are different, many need to deal with separately, so I need to determine what the browser is. The JS code is as follows:
varNV = {}; varUA =navigator.userAgent.toLowerCase (); Try{Nv.shell= (Ua.indexof (' Ucbrowser ') >-1)? ' UC Browser '://Ucbrowser(Ua.indexof (' Dolphin ') >-1)? ' Dolphin Browser '://DOLPHINBROWSERCN(Ua.indexof (' Huohou ') >-1)? ' Fire Monkey Browser '://Huohoubrowser(Ua.indexof (' Sogou ') >-1)? ' Sogou Browser '://Sogoumse/sogoumobilebrowser(Ua.indexof (' OPR ') >-1)? ' Open Gate Browser '://OPR(Ua.indexof (' Qqbrowser ') >-1)? ' QQ Browser '://Mqqbrowser(Ua.indexof (' Liebao ') >-1)? ' Cheetah Browser '://Liebaofast(Ua.indexof (' 2345 ') >-1)? ' 2345 Browser '://Mb2345browser(Ua.indexof (' Miui ') >-1)? ' Xiaomi Browser '://Miuibrowser(Ua.indexof (' Baidu ') >-1)? ' Baidu Browser ': (Ua.indexof (' Aoyou ') >-1)? ' Surfing the browser ': (Ua.indexof (' TheWorld ') >-1)? ' window of the World browser ': (Ua.indexof (' Worldchrome ') >-1)? ' window of the World Speed Browser ': (Ua.indexof (' Greenbrowser ') >-1)? ' Green Browser ': (Ua.indexof (' 360ee ') >-1)? ' 360 Speed Browser ': (Ua.indexof (' 360SE ') >-1)? ' 360 Secure Browser ': ' Unknown or no shell ';}Catch(e) {}alert (' Browser ua= ' +ua+ ' \ n \ nthe browser shell = ' +nv.shell ';
The note above is the name of the full version of the pro-test.
2. There are some browser speed mode, or some speed browser does not support JS, so you have to decide whether to support JS. I did not find a way to judge, but found the following methods. The code is as follows:
<noscript>sorry, your browser does not support javascript!</noscript>
But it's hard to use this when the graceful downgrade, a lot of a stick killed, but because there is no other good way to use this for the time being.
What's the problem welcome everyone to guide ~ ~ ~
A series of issues with mobile web presence