A series of issues with mobile web presence

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.