当我的Flash网站在非Flash浏览器中打开时,如何重定向到html页面?
以下是我正在使用的代码
<link rel="shortcut icon" href="/77east.ico" type="image/x-icon" />
<!--[if lte IE 8]>
<script type="text/javascript">window.location = 'ebrowser.html'</script>
<![endif]-->
<script type="text/javascript">
if (swfobject.hasFlashPlayerVersion("7.0.0")) {
// User has flash
} else {
// User does not have flash
window.location="ame.html";
}
</script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body style="background-color:#4B4C4B">
<div id="pad"></div>
<div id="content">
<div style="height:560px; overflow:hidden; width:1000px; margin:0 auto; ">
<div style="width:1000px;"><object type="application/x-shockwave-flash" data="index.swf" width="1000" height="500"> <param name="movie" value="index.swf" /> <param name="BGCOLOR" value="#4B4C4B" /> </object></div>
</div>
</div>
答案 0 :(得分:2)
您的网站需要swfobject.js: http://code.google.com/p/swfobject/
一旦包含了swfobject.js,这个块就可以了,只需将noFlash.php替换为你要加载的页面
if (swfobject.hasFlashPlayerVersion("7.0.0")) {
// User has flash
} else {
// User does not have flash
window.location="noFlash.php";
}
这个网站解释了一下: http://rossholdway.com/blog/redirect-if-flash-is-not-installed
答案 1 :(得分:1)
我建议使用JavaScript Flash Detection Library并使用javascript重定向用户:
<script type="text/javascript">
if(!FlashDetect.installed){
location.href='http://mysite.com/no_flash.html';
}
</script>