Home > Web Front-end > JS Tutorial > How to detect whether the flash plug-in is disabled using javascript_javascript skills

How to detect whether the flash plug-in is disabled using javascript_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 15:20:07
Original
1634 people have browsed it

The example in this article describes the method of using javascript to detect whether the flash plug-in is disabled. Share it with everyone for your reference, the details are as follows:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus&reg;">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
  <script>
    function demo(){
      var flag = false;
      if(window.ActiveXObject){
        try{
          var swf = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
          if(swf){
            flag = true;
          }
        }catch(e){
        }
      }else{
        try{
          var swf = navigator.plugins['Shockwave Flash'];
          if(swf){
            flag = true;
          }
        }catch(e){
        }
      }
      if(flag){
        console.log("running ok");
      }else{
        console.log("running error");
      }
    }
  </script>
</head>
<body>
<button onclick="demo();">click</button>
</body>
</html>

Copy after login

I hope this article will be helpful to everyone in JavaScript programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template