Javascript 在非flash浏览器中打开站点时重定向到html页面
当我的flash站点在非flash浏览器中打开时,如何重定向到html页面 下面是我目前正在使用的代码Javascript 在非flash浏览器中打开站点时重定向到html页面,javascript,html,flash,Javascript,Html,Flash,当我的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'</
<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>
if(swfobject.hasplashplayervision(“7.0.0”)){
//用户拥有flash
}否则{
//用户没有闪存
window.location=“ame.html”;
}
我建议使用javascript并重定向用户:
<script type="text/javascript">
if(!FlashDetect.installed){
location.href='http://mysite.com/no_flash.html';
}
</script>
如果(!FlashDetect.installed){
location.href=http://mysite.com/no_flash.html';
}
您的网站需要swfobject.js:
一旦包含了swfobject.js,这个块就可以了,只需将noFlash.php替换为您想要加载的页面即可
if (swfobject.hasFlashPlayerVersion("7.0.0")) {
// User has flash
} else {
// User does not have flash
window.location="noFlash.php";
}
本网站对此做了一些解释:
您是否有我可以查看的页面?您需要在顶部添加“swfobject.js”脚本。否则,您将无法在javascript中引用“swfobject”对象!