Js judges mobile phone or PC. We have this code in almost all websites. Now the mobile phone traffic is almost the same as that of pc. Let's take a look at two sections of js to determine mobile phone or PC. Example 1
《script》fu
Mobile Access to the PC version of the website automatically jump to the mobile version of the pagefunctionGetmcookie (objname) {varArrstr = Document.cookie.split (";"); for(vari = 0; i ) { vartemp = arrstr[i].split ("="); if(Temp[0] = =objname) { returnUnescape (temp[1]); } } return"";}functionBrowserredirect () {varSuseragent =navigator
When users visit your site, if it is PC-side access, then do not do, if it is mobile phone or tablet access, jump to their own definition of the mobile phone page, this is often used when doing webapp, the code to share to everyone, I hope to help you.First, you have to refer to a JSUAREDIRECT.JS,JS source in the page as follows:functionUaredirect (f) {Try{if(doc
document function, not only can connect the local network printer via WiFi, but also can connect to the printer of their office through the mobile phone, Tablet PC and TV, convenient to the document printing in the Office, solve the difficulty that can only be printed by PC. Improve the work efficiency, really let the office achieve
Wordpress plugin is really a very powerful existence, mainly used in the Wordprss hook,filter (Hook, filter), but plug-in loaded, page loading will be slower. :-DPlugin has a lot of free, some time ago there is a project need to use two themes, mobile phone on the theme of the PC with the theme of the PC, the data is shared. Looking for a long time, also looked f
This is only a small knowledge, but also on the internet to find, pretty good!
Dynamic to determine whether the browser is a PC or mobile end!
Very interesting!
The above is JS dynamic Judge pc and mobile browser data collation, follow-up continue to supplement the relevant information, thank you for your su
After a PDF file is generated by referencing tcpdf, you can preview it in the pc browser, and then download it directly in the mobile browser. how can you preview tcpdfpdfphphtml in the mobile browser?
After a PDF file is generated by referencing tcpdf, you can preview the file in the pc browser and download the
PC version of the Web page automatically identify mobile clients and jump, using JS to determine whether the mobile phone client to jump the best, especially static Web pages, the process through the JS way of User Client execution, can greatly reduce the server side of the additional processing pressure. But sometimes it needs to be judged on the server side exc
Recent customer requests to use JavaScript to implement video carousel:
Interested students can participate in the Open
The following write a program to achieve video carousel, PC end and mobile end can be realized,
But the mobile side, there is a little bug;
Copy Code code as follows:
Operation Effect:
function Mobile_device_detect (URL) {varThisos =Navigator.platform; varOS =NewArray ("IPhone","IPod","IPad","Android","Nokia","SymbianOS","Symbian","Windows Phone","Phone","Linux armv71","MAUI","untrusted/1.0","Windows CE","BlackBerry","Iemobile"); for(vari =0; i ) { if(Thisos.match (Os[i])) {window.location=URL; } } //because quite a part of the cell phone system does not know the information, here is to do temporary special identification if(Navigator.platform.indexOf ('IPad')
1, through the link tag to judge to joinI've heard of adding media = "handheld" to the link tag, but this doesn't work with either Android or Apple, and it works by trying the following methods.(max-device-width:1080px)" >2, through the JS to determine whether the browser is a mobile phone or computer, and then add to the CSS link tag can be. Determine if the cell phone method is as followsfunction Isphone () { var useragentinfo = navigator.userage
This article describes the JS compatible PC-side browser and has a variety of pop-up tips for mobile phone-side floating-layer control. Share to everyone for your reference. Specifically as follows:
Full instance code click here to download the site.
Usage
or call it in jquery:
Inheriting class alert and confirm hints (in jquery mode):
Html:
Js:
$ (' #btn
JS in the Web page how to determine whether the device type is mobile or PC end.
sometimes in the project encountered equipment type judgment problem, here and you share a JS Judge device type method;
This method not only solves the problem of the device type, but also can change the link of the Web page directly according to the device type.
When it comes to device type judgments, here's the HTML DOM us
In recent years, with the popularity of mobile phones and pad, more and more users choose to use mobile clients to access the site, and in order to obtain a better user experience, it is necessary to display the most suitable match for different devices, this is the popular "responsive web Design" in recent years.Responsive web Design is a pure front-end technology JS, CSS and other implementations for diff
Nowadays, with more and more people using smartphones, the mobile internet is moving forward at an unprecedented rate, according to the latest report of China Mobile Internet data counting and 2015 forecast published by the Yi-think-tank. China Mobile internet users up to 730 million people, and the end of 2014 Internet netizens only 648 million, it can be said t
In view of the site's compatibility under a variety of devices, there are very many sites will have mobile version and the computer version of the two version number. Visit the same site URL when the server identifies the user using the computer. Open the computer version of the page, the user assumes the use of mobile phone access, you will get the mobile versio
Now, with the advent of the mobile era, gradually improve the function of mobile phones, various industries for this phenomenon have formulated a corresponding marketing plan, so suddenly arose a online booking/online booking/online reservation craze.And for IT industry, become Enterprise Informatization is the most popular pronoun is mobile office, almost all so
the development of artificial intelligence, Even as Microsoft developed its Xiaoice in China, it was eager for Baidu's search data. and mobile multi-point offensive strategy, Baidu in the PC market position is stable, so it seems only to use Baidu defender this product attack and guarding the client market, Baidu Defender 7.0 version on-line, more means that Baidu pc
In view of the site's compatibility under a variety of devices, there are many websites will have mobile version and computer version of two versions. Visit the same website URL, when the server identifies the user to use the computer access, open the computer version of the page, if users use mobile phone access, you will get the mobile version of the page.1, de
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.