tags:

views:

161

answers:

7

Let's say I have Flash-version of and non-Flash version of my website. When a user comes to my website, is there any way to create the following logic:

if (user has flash-plugin installed) { load flash website }

else { load non-flash website }

While we are here. Can I do the same for the bandwidth control? Let's say a Cable customer visits my websites. He has no problem loading my 10mb fully loaded flash website with background videos. But if someone with a slow internet connection visits my website, can I skip the Flash website and re-direct that user to non-Flash website?

If there's no way to accomplish this, is there any workaround, any at all?

Thanks in advance!

A: 

its not possible...u hav to use javascript

Deepak
+1  A: 

No, this is not doable in pure HTML. You would need the assistance of JavaScript, or maybe a server-side language like PHP, or Server Side Includes (although detecting Flash is best done using JS.)

The only "if/else" there is is for the presence of JavaScript. Anything inside a noscript tag will be shown only in browsers that don't support JavaScript or have it turned off.

<noscript>You have JavaScript turned off!</noscript>
Pekka
+1  A: 

You would use Javascript. Here is Adobe's Flash detection instructions page: http://www.adobe.com/support/flash/how/shock/javaplugs/

Connection speed is a little more complicated and requires doing a bunch of things to test capabilities (again with javascript). Here is a proof-of-concept of this method: http://alexle.net/archives/257

hollsk
+2  A: 
loentar
+11  A: 

HTML has a limited set of "if/else" test on the browser's capabilities, e.g. whether it can handle scripts (<noscript>), frames (<noframes>), etc.

Your case on Flash-plugins can be handled by fallback content of <object>, for example:

<object type="application/x-shockwave-flash" data="x.swf" width="400" height="300">
   <param name="movie" value="x.swf" />
   <p>Your browser does not support Flash etc etc etc.</p>
</object>

(See Providing alternative images if Adobe Flash isn’t available for more alternatives.)

But it's not possible to have a bandwidth control with HTML alone.

KennyTM
+1  A: 

You can't do this in HTML. But you can use javscript for it. (Something like this)

Rob
A: 

HTML is a document format, not a language. There are a few limited things you can do based on how the browser interprets certain tags, but you should really be using Javascript.

Brad