I want to create a website that can be visited by type of browsing device and when the user visits the site on different devices (iPad, iPhone, Netbook, PC) they immediately see the version of the site optimized for them instead of having to go to m.example.com . I know that you can specify html to print etc. Is there a type for device sizes and types (multitouch vs. mouse based)?
Share
Yes, your webserver can examine the USER_AGENT string that comes with every request. Each of thee devices you mention will send a string uniquely identifying what it is. I’m on a mobile device now, and don’t have references, but you’ll find what you need if you google ‘useragent’.
Once you know the device, you can easily send device-specific HTML, stylesheets and/or JavaScript to tailor the experience for each device.
Good luck!