JS detects if the Flash Player plugin is installed in the browser

Source: Internet
Author: User

These two days work need to embed flash games in the webpage, I use Swfobject.js version:1.5. Other aspects are very good, only version detection here has been no straightened out, and then really helpless, use JS to detect the browser Flash plug-in situation, the code is as follows:

<script>functionFlashchecker () {varHasflash = 0;//whether the Flash is installed    varflashversion = 0;//Flash version    if(document.all) {varSWF =NewActiveXObject (' Shockwaveflash.shockwaveflash '); if(SWF) {Hasflash= 1; vswf= swf. GetVariable ("$version"); Flashversion= parseint (Vswf.split ("") [1].split (",") [0]); }    } Else {      if(navigator.plugins && navigator.plugins.length > 0) {        varswf = navigator.plugins["Shockwave Flash"]; if(SWF) {Hasflash= 1; varWords = Swf.description.split ("");  for(vari = 0; i < words.length; ++i) {if(IsNaN (parseint (words[i)))Continue; Flashversion=parseint (Words[i]); }        }      }    }    return{f:hasflash, v:flashversion}; }  varFLS =Flashchecker (); vars = ""; if(FLS.F) document.write ("You have Flash installed, the current Flash version is:" + fls.v + ". X"); Elsedocument.write ("You do not have Flash installed"); </script>

JS detects if the Flash Player plugin is installed in the browser

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.