2

http://www.javascriptkit.com/script/script2/plugindetect.shtml

I am trying to detect flash plugin with Javascript from the above url, but the code doesn't seem to work for IE. Am I doing anything wrong here?

I just need to see whether the flash plugin is installed on the browser or not.

if (pluginlist.indexOf("Flash")== -1)
{
  alert("You do not have flash player plugin installed.Please install flash player");
  window.location = "/home";
}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Rajeev
  • 44,985
  • 76
  • 186
  • 285
  • possible dupe http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-info – Ryan Fernandes Jan 05 '11 at 09:30
  • Does this answer your question? [How can I detect if Flash is installed and if not, display a hidden div that informs the user?](https://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-inf) – Brian Tompsett - 汤莱恩 Nov 03 '20 at 12:25

3 Answers3

1

swfobject is the established quasi-standard for dealing with flash in JavaScript.

There's a tutorial for Detecting Flash Player versions and embedding SWF files with SWFObject 2

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
1

i too tried the same flash plugin but in different link. I tried the following javascript code:

<script type="text/javascript" src="swfobject.js"></script>

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so =
       new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.write("flashcontent");
</script>

Prepare an HTML element that will hold our Flash movie. The content placed in the ‘holder’ element will be replaced by the Flash content, so users with the Flash plug-in installed will never see the content inside this element. This feature has the added bonus of letting search engines index your alternate content.

var so = new SWFObject(swf, id, width, height, version, background-color
         [, quality, xiRedirectUrl, redirectUrl, detectKey]);

And get succeeded. You can also try this code and tell me what happens. I hope you will get success. All The Best.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Nisha
  • 56
  • 3
0

I tried to use the same plugin of the link you posted.

I used following code and it worked fine in my IE too..

<html>
    <head>

        <script language="javascript" type="text/javascript" src="plugins.js" ></script>

        <script language="javascript" type="text/javascript">
            if (pluginlist.indexOf("Flash")== -1)
            {
              alert("You do not have flash player plugin installed.Please install flash player");
              window.location = "/home";
            }
            else{
                alert("You have it installed");
            }
        </script>
    </head>

    <body>


    </body>
</html>

I think the problem seems with the way of writing tag. Have you made it exactly like mine? Or you can go with my HTML.

Thanks!

Hussain

eHussain
  • 3,297
  • 1
  • 21
  • 19