1、新建html文档。
2、书写hmtl代码。<h1>方法一:</h1><h1>纯js检测用户浏览器是否安装flash插件</h1><h3>若已经安装flash,则返回true,反之false</h3>
3、书写css代码。<style> body{text-align: center} </style>
4、书写并添加js代码。<script>function hasFlash(){ if (navigator.plugins && navigator.plugins.length && navigator.plugins['Shockwave Flash']) { return true; } else if (navigator.mimeTypes && navigator.mimeTypes.length) { var mimeType = navigator.mimeTypes['application/x-shockwave-flash']; return mimeType && mimeType.enabledPlugin; } else { try { var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); return true; } catch (e) {} } return false;}alert(hasFlash());</script>
5、代码整体结构。