JavaScript and Flash detection

Discussion in 'Javascript' started by Mika S., Jun 27, 2003.

  1. Mika S.

    Mika S. Guest

    Hi,

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

    Thanks,
    Mika
     
    Mika S., Jun 27, 2003
    #1
    1. Advertisements

  2. A good piece of code is available at
    http://www.dithered.com/javascript/flash_detect/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, Jun 27, 2003
    #2
    1. Advertisements

  3. Mika S.

    Mika S. Guest

    Thanks for that, Randy. A very good point.

    Mika
     
    Mika S., Jun 28, 2003
    #3
  4. 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, Jun 30, 2003
    #4
  5. 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, Jun 30, 2003
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.