One webpage - targeting multiple devices and browsers...
Discuss One webpage - targeting multiple devices and browsers... in the HTML Programming forum on Dev Shed. One webpage - targeting multiple devices and browsers... HTML Programming forum covering discussions of HTML and XHTML, as well as HTML-related issues such as writing W3C Compliant code. Use HyperText Markup Language for building websites.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 9
Time spent in forums: 2 h 16 m 7 sec
Reputation Power: 0
One webpage - targeting multiple devices and browsers...
I have a single HTML page that needs to work across a number of devices and browsers. The page only needs to react in one of two ways - with Flash (desktop) or without (mobile).
On the desktop side, we have all of the usual browsers working perfectly fine. Flash is embedded via swfobject - it replaces any of the content specifically related to mobile.
For mobile, we are using CSS media queries (screen width) to target different devices on the mobile side. That seems to work OK, but I want to go a step further with it.
For instance, when viewing the page with an android tablet, which has Flash installed, they are fed Flash - which I don't want.
Essentially, if the browser has Flash installed, the SWF will load. If it doesn't, then the user is fed the Mobile experience.
I would like to change this so that I can target ANY mobile device to load the mobile experience and target all desktop browsers to load the Flash experience.
I've been told that regexxing the user agent string is not the way to go. Other than detecting screen width (which would NOT work properly in the case of the android tablet - resolution is usually 1280x800), I'm not sure what else to do.
Posts: 5,568
Time spent in forums: 2 Months 2 Weeks 1 Day 10 m 27 sec
Reputation Power: 3292
You have limited options for detecting browsers. Build both versions and provide a manual toggle switch that lets the user choose which one they prefer.
You can keep the auto-detect you currently have so most users will probably end up on the correct page, but leave two small links that the bottom of the page that will override the choice, say:
Quote:
View the Full or Mobile experience.
If they choose full, let the flash load (provided it is available, optionally show a message if not). If they choose mobile, disable the flash regardless of if they are on a desktop of not.