当网站在非Flash浏览器中打开时重定向到html页面
问题描述:
当我的Flash网站在非Flash浏览器中打开时,如何重定向到html页面?当网站在非Flash浏览器中打开时重定向到html页面
这里是我curently使用
<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>
答
您需要在您的网站swfobject.js: http://code.google.com/p/swfobject/
一旦包含swfobject.js,这个块应该做的伎俩,只是用pag替换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
答
我会建议使用JavaScript Flash Detection Library,并与JavaScript重定向用户代码:
<script type="text/javascript">
if(!FlashDetect.installed){
location.href='http://mysite.com/no_flash.html';
}
</script>
+0
这不是工作要么 – Sowmya 2012-02-29 06:02:27
这不是工作 – Sowmya 2012-02-29 06:00:06
你有网页的地方,我可以看看吗? – Developer 2012-02-29 06:00:50
我在我的问题中添加了我的代码。请看一看。 – Sowmya 2012-02-29 07:42:27