472,121 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

JavaScript and Flash detection

Hi,

How can I detect if the Flash plugin is installed? Should be working
with the most common browsers and environments.

Thanks,
Mika

Jul 20 '05 #1
5 11247
"Mika S." wrote:
How can I detect if the Flash plugin is installed? Should be working
with the most common browsers and environments.


A good piece of code is available at
http://www.dithered.com/javascript/f...ect/index.html, works well
for all current browsers if you modify the call like this:

<script language="Javascript" type="text/javascript">
//<![CDATA[
function getFlashVersion() { return null; };
//]]>
</script>
<script language="Javascript" type="text/javascript"
src="flash_detect.js">
</script>
--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #2
In article <bd**********@phys-news1.kolumbus.fi>, "Mika S."
<mi**********@koti.soon.fi> writes:
Hi,

How can I detect if the Flash plugin is installed? Should be working
with the most common browsers and environments.

Thanks,
Mika


<script type="text/javascript">
var flashEnabled = confirm('Click OK if you have Flash, click Cancel if you do
not have the Flash plugin');
if (flashEnabled)
{alert('Wow, you have Flash!')}
else
{alert('OOOps, No Flash installed')}
</script>

Anything else you try will have flaws. Even the above has flaws. How do you use
javascript to detect flash is javascript is disabled?
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #3
"HikksNotAtHome" <hi************@aol.com> wrote in message
news:20***************************@mb-m13.aol.com...
Anything else you try will have flaws. Even the above
has flaws. How do you use javascript to detect flash
is javascript is disabled?
--
Randy


Thanks for that, Randy. A very good point.

Mika

Jul 20 '05 #4
"Mika S." wrote:
"Klaus Johannes Rusch" <Kl********@atmedia.net> wrote in message
news:3E***************@atmedia.net...
How can I detect if the Flash plugin is installed? Should be
working with the most common browsers and environments.


A good piece of code is available at
http://www.dithered.com/javascript/f...ect/index.html,


Thanks a lot! That was perfect.

By the way, do you know if the script is freeware and free for
commercial purposes, too?


See http://www.dithered.com/javascript/index.html: "This is a collection
of scripts that I've created and/or modified. Do whatever you want with
them. All I ask is that any comments in the code remain as is"

--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #5
HikksNotAtHome wrote:
<script type="text/javascript">
var flashEnabled = confirm('Click OK if you have Flash, click Cancel if you do
not have the Flash plugin');
if (flashEnabled)
{alert('Wow, you have Flash!')}
else
{alert('OOOps, No Flash installed')}
</script>

Anything else you try will have flaws. Even the above has flaws. How do you use
javascript to detect flash is javascript is disabled?


I suspect that Flash plugin detection will work more reliably than asking users
whether or not they have Flash installed ("Do I have what installed?") If
Javascript is not available falling back to the plain, non-Flash version is usually
a reasonable alternative.

<script type="text/javascript">
if (goodFlashVersion) {
document.write('<!-- put flash stuff here -->');
}
else {
document.write('<!-- put plain version here -->');
}
</script>
<noscript>
<!-- put plain version here -->
</noscript>

--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by kevin | last post: by
6 posts views Thread by Gustav Medler | last post: by
3 posts views Thread by Jake | last post: by
1 post views Thread by Karl | last post: by
5 posts views Thread by Olly | last post: by
1 post views Thread by critchey1 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.