我建立了一个网站,并且有一些 Flash 元素。我如何识别用户的浏览器是否支持 Flash 并在不支持时显示新元素?
最佳答案
看看SWFObject
这是一个 JavaScript 库,可让您在 JS 和 Flash 之间很好地发挥作用,并为您提供一些回退的机会。
例如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>SWFObject dynamic embed - step 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
关于css - 我可以在我的网站中显示 flash 元素的替代元素吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19790393/