How can I detect browser support of Flash in JavaScript? [duplicate]
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.
精彩评论