To Flash or Not to Flash? That is the question.
October 24, 2011 11:57 AM   Subscribe

Simplest way to check for the presence of Flash on a client's web browser, and then redirect depending on the answer?

I cobbled together my web site many years ago using good old fashioned HTML. My site is a home page, an info and contact page, and a set of galleries. I use the JAlbum flash template called Bananalbum to handle the galleries. It took me a while to figure out how to make those work seamlessly with the rest of the site, but all has been working well for the last two years.

I feel comfortable enough working in HTML for simple things, but everything else, from CSS to Javascript, is a real mystery to me.

What is the most simple way that I can have my non-gallery pages determine that a visitor is on an iOS device, and therefore direct the visitor to an alternative set of pure HTML gallery pages when he or she clicks the link to the galleries? I can create these pages, which will be very simple, without any problem.

Can what I want to do be done in HTML alone?

Thanks in advance for any suggestions.
posted by imjustsaying to Computers & Internet (6 answers total)
It's going to be much easier to just redirect based on user-agent, I'd think. Here's one project.
posted by odinsdream at 12:03 PM on October 24, 2011

Not that I'm an advocate for flash web development (just the opposite in fact), but your product seems to do it out of the box.
For mobile devices such as the iPhone, iPad or Android, BananAlbum switches to a viewing mode that is optimized for small screens with touchscreen (sample of the mobile viewer).
Chances are what you're looking to do (the entire image album thing that BananAlbum does) can be done with the latest in HTML, CSS and jQuery and degrade nicely, as opposed to being an "all or nothing deal" like BananAlbum is.

There are also some downsides to browser sniffing or user-agent redirecting.
posted by Brian Puccio at 12:13 PM on October 24, 2011

Can what I want to do be done in HTML alone?

No, it requires javascript.
posted by tylerkaraszewski at 12:13 PM on October 24, 2011

Thank you for thinking about people on iOS devices (she typed on her iPad).

But. iOS users aren't the only ones who might prefer a non-Flash version; and presumably some people enter your site by going directly to a gallery page, via a Google result or a link posted somewhere.

So, especially given that you're not comfortable with JavaScript, it might be better to sidestep the problem and offer all your visitors the choice, instead of trying to make the choice for them (which, as Brian Puccio points out, can be problematic anyway). Put a link to the non-Flash version on each gallery page (and "hey, there's a prettier version, you know..." links to the Flash galleries on the pure HTML versions too). People who can't install Flash or have chosen not to, people who haven't got round to updating it to the latest version, people who prefer not to enable it by default, and people who'd like to be able to bookmark (or direct friends to) specific images within your galleries will all thank you for it.
posted by ManyLeggedCreature at 12:50 PM on October 24, 2011

No, it requires javascript.

You can redirect based on user-agent with server-side scripting, or directly with the web server itself. It's certainly easier to do with Javascript, though.
posted by odinsdream at 1:00 PM on October 24, 2011

One thing to be aware of as well is that most of these scripts seem to fail if you use FlashBlock. It drives me nuts when I don't see a little "f" I can click but instead get redirected me to some page chastising me for not having Flash. In your case it probably doesn't apply since it would redirect me to a version that works just fine and is Flash-free, which is probably what I'd like anyway. Something to be aware of for general use though.

What do you need the Flash for in the first place anyway? If what you want can be accomplished in HTML and related technologies, and you're going to the trouble of a redesign anyway, why not just go all the way?
posted by vsync at 3:41 PM on October 24, 2011

« Older What to do in NOLA that isn't a tourist...   |   Pesto-- more like PestNo! Newer »
This thread is closed to new comments.