Lena Queen Lena Queen - 9 months ago 46
CSS Question

What is better: CSS media queries or JQuery mobile?

I'm newbie for developing mobile website. I very confused between two methods because I dont have any experience this it. Whats more better between two methods: css query when we using all of width device in css file or using jquery mobile that use php technique for differented user that use desktop or mobile [user->php?->mobile use jquery mobile/desktop use css standard]?

Many thanks for this answer

Answer Source

I will classify methods by their importance, from most important one to less important:

Client side detection

Using Modernizer javascript library to detect mobile / desktop environment

Server side detection

Using Modernizer Server or WURFL. Little complex then first solution but much more detailed (if you need more data about used device)

CSS media queries

Bad solution to detect desktop /mobile devices. Current mobile devices can have screen resolution equal to desktop platform

JavaScript based browser sniffing

Worst solution possible. Specially if you want to make distinction between smartphones and tablets.

To find more about this solutions, read my other article/answer with examples: http://stackoverflow.com/a/15055352/1848600