473,544 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11369
"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="Javas cript" type="text/javascript">
//<![CDATA[
function getFlashVersion () { return null; };
//]]>
</script>
<script language="Javas cript" type="text/javascript"
src="flash_dete ct.js">
</script>
--
Klaus Johannes Rusch
Kl********@atme dia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #2
In article <bd**********@p hys-news1.kolumbus. fi>, "Mika S."
<mi**********@k oti.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********@atm edia.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********@atme dia.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 (goodFlashVersi on) {
document.write( '<!-- put flash stuff here -->');
}
else {
document.write( '<!-- put plain version here -->');
}
</script>
<noscript>
<!-- put plain version here -->
</noscript>

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4798
by: kevin | last post by:
hi there, can you alter or give advice to the following code . I Basically want to detect for flash player 6 onClicking a button and if flash player is not correct write to screene bla bla bla you are being redirected how do I position the text too? or maybe I should use a popup?:-) I have the onClick function to goto "function version()"...
4
1980
by: kevin | last post by:
meta refresh tag is failing , it is supposed to go to the entry1.htm site which is the flash swf file but it doesn't check code please http://members.optusnet.com.au/~kevindauth/ thanks kevin
6
4749
by: Gustav Medler | last post by:
Hello, there is a known problem with Opera and the execution of content shown in <NOSCRIPT> tag. Everythings works fine, if there is only one simple script like: http://www.dr-wald.de/test/Opera-NOSCRIPT.html Switching off Javascript will show the alternative content. Javascript enabled will only show the JS-content, _not_ the <NOSCRIPT>...
6
3549
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are referenced in the script so I presume that Firefox needs to be added somewhere -- does anyone know how I could update this to be supported by Firefox?...
3
3045
by: Jake | last post by:
Im using some custom javascript:history.forward() & javascript:history.back() image buttons on my application. If there is no back or forward history, I would like to display a dimmed(disabled look) image. Is there a way to detect if there is no history in iether direction? Thanks!
1
1893
by: Karl | last post by:
I am looking for some flash detection code for an asp.net website, but all the samples I find are in classic asp and Im having trouble converting them over. Does anyone have any flash detection code written in asp.net that I could look at or use? Thanks
1
2238
by: spidermo | last post by:
I have been trying to find a method to detect when a cd has been inserted. I would prefer to use java, but I am open to other languages as well. I came up with a method that uses a timer to query the drive itself, but I do not think that is a very efficient/proper method to do what I want. The reason I included flash is because I would guess...
5
2751
by: Olly | last post by:
Hello Group: I'd be grateful to anyone who can help me with Javascript form. :-) I want users to submit a web form, but to stop the form submission if any of my text fields contain specific value (e.g. "http"). I incorporated "http" detection bits of script into my existing function (only for one of my fields for now ), but for some...
1
2713
by: critchey1 | last post by:
Hey everyone, i've been playing around with trying to get some scripts to work with detecting whether flash player is installed on your computer or not. I found a flash detection kit on the adobe site which had a client side detection method using javascript. Basically what im trying to get it to do is if flash player is installed, use the...
0
7438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7632
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7720
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5309
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3422
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
996
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.