admin管理员组文章数量:1302303
Can anyone remend the best way to detect mobile device accessing a site - we want to re-direct to a mobile version rather than restyle the existing page due to CMS restrictions.
We also need the option to be able to return to the full site on mobile if requested.
We have a server, but aren't developers so would have to pay for dev work to be done server side - we are just wondering the best method to use.
Can anyone remend the best way to detect mobile device accessing a site - we want to re-direct to a mobile version rather than restyle the existing page due to CMS restrictions.
We also need the option to be able to return to the full site on mobile if requested.
We have a server, but aren't developers so would have to pay for dev work to be done server side - we are just wondering the best method to use.
Share Improve this question edited Apr 20, 2012 at 14:49 Crab Bucket 6,2779 gold badges41 silver badges73 bronze badges asked Mar 6, 2012 at 15:51 DancerDancer 17.7k40 gold badges131 silver badges213 bronze badges6 Answers
Reset to default 5take a look at this URL: http://detectmobilebrowsers./
they have code for both server side and client side (jQuery/JavaScript).
If by directing to a mobile version you mean just a design change specific to mobile and not functionality changes for mobile users, then look into Responsive design which dynamically changes your design based on resolution of the current users view using media queries.
Media Queries Spec W3C
Responsive Design Guidelines
This approach should not be limited by any kind of CMS as it is straight CSS use.
See below link i have answered here it might help you. same question as you asked Dear Paul.
Auto Mobile Site Redirect
Snippets for below are present on above link.
- Detecting Smartphones Using JavaScript
- Detecting Mobile Devices Using PHP
- iPhone & iPod Detection Using JavaScript
- Detect mobile.js and github etc.
As pritaes suggested, I'd remend WURFL. The new cloud-based detection service is now available with free accounts and new capabilities like "jqm_grade", which tells you the jQuery Mobile Grade (support level), so you know what type of content to serve before sending it to an unsupported device.
Personally, for server side detection I like WURFL. It has a .NET API available.
There are open source options that arn't cloud based if you want something you have more control over. 51Degrees.mobi are worth checking out. They have implementations in PHP, C, as well as a few others. I've used them before now and found them to be pretty good. There's also a really in depth article on the Nokia developers website about device detection that's worth a read.
本文标签: javascriptMobile site detection server side vs client sideStack Overflow
版权声明:本文标题:javascript - Mobile site detection server side vs client side - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741690436a2392690.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论