i'm having a finished website and need to optimize it for mobile devices (ipad/iphone/smartphones ..). what's the best way to detect which mobile device/browser is used? (eg. by jquery-plugin) thanks
JavaScript/jQuery is not the best way at all; apart from iPhones etc remember there are also Nokias, and other non-smart phones, which may or may not run JavaScript at all, and if they do, it won't be particularly quickly. Attempting to reconfigure your site using JavaScript on a phone over a few years old is pretty much just going to freeze the phone for at least a second or two whenever a page loads.
I would strongly suggest you look into doing this on the server side as much as possible - even if it's as simple as just swapping the stylesheet. At the basic level you can check the User-Agent header sent by the browser and work it out from there. In PHP, use the get_browser function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With