By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

JavaScript and Flash detection

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
"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

P: n/a
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.