Simple Smart Phone detection

后端 未结 2 1791
星月不相逢
星月不相逢 2020-12-06 14:04

Ok I\'ve seen a couple of mobile detection scripts that look to identify all mobile handsets, anyone come up with a simple Smart Phone detection script?

I\'m using t

2条回答
  •  自闭症患者
    2020-12-06 14:26

    I am not pretty sure if I understand what you are trying to achieve and with "wanted to theme based on device".

    So, will you put a BlackBerry logo if the user has a BlackBerry device (so it should be dependent on the manufacturer) or will your web app be denpendent on the screen size? Or depenedent on the features of HTML5/CSS3?

    Also in web development I try to do one website for all. The same I do with jQuery Mobile and it works great. I did one design, which works for Opera (Win), Firefox (Win + Mac), IE9, Safari (Win, Mac, iPad), Google Chrome (Win). And I do no CSS hacks! Your web app should be nearly independent of the screen size, I only have css media limitations and some JavaScript functions which design the page.

    If you want to check the HTML5 / CSS3 support of the webbrowser, you should never check the mobile device itself, you need to check the function itself. So, bad style is checking if the webbrowser is IE in version 7, 8, 9, because you will never know which function will work in which version. You check the functionality you need. And this can be done with Modernizr:

    http://diveintohtml5.ep.io/detect.html#modernizr

    http://www.modernizr.com/

    Other checks, jQuery can handle it.

提交回复
热议问题