开发者

How can I detect browser support of Flash in JavaScript? [duplicate]

This question already has answers here: Closed 11 years ago.

This my HTML code but if the browser does not support Flash then I want to replace the image in the Flash part

<!DOCTYPE html PUBLIC "-//开发者_StackOverflow社区W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script type="text/javascript">
      if (typeof navigator.plugins['Shockwave Flash'] !== 'undefined') {
        alert('support');
      } else {
        alert('not support');
      }
    </script>
  </head>

  <body>
  </body>
</html>


I would use one of the Flash Detection JavaScript libraries out there. This one works well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜