如何检测浏览器是否支持Flash? [英] How to detect if the browser support flash?

查看:1577
本文介绍了如何检测浏览器是否支持Flash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有我的网站的两个版本

一个是支持Flash的设计(如桌面),另一个是移动设备



我只想知道,如果我可以检测,如果是真的(支持),他们将保持相同的网站假设是 http://mywebsite.com 但链接将显示 http://mywebsite.com/?flash=true ,如果不支持,我会将它们重定向到 http ://mywebsite.com/?flash = false



对于愚蠢的问题抱歉,您不必给我一个答案,但如果你可以给我提供一些资源,我可以在哪里挖掘信息并自己研究一下。



谢谢。



  var _flash_installed =((typeof navigator.plugins!==undefined&& typeof navigator.plugins [Shockwave Flash] ===object)||(window.ActiveXObject&&(new ActiveXObject( ShockwaveFlash.ShockwaveFlash))!== false)); 


I just have two version of my site

one is design for Flash supported (like Desktop) and the other one is for Mobile devices

I just want to know if I can detect and if is true (support) they will stay the same website assuming is http://mywebsite.com but the link will display http://mywebsite.com/?flash=true and if is not support I will redirect them to http://mywebsite.com/?flash=false

sorry for the dumb question you don't have to give me an answer but if you can provide me some sort of resource where can I dig the information and study about it myself

Thanks.

解决方案

This javascript code fragment will do the job:

var _flash_installed = ((typeof navigator.plugins !== "undefined" && typeof navigator.plugins["Shockwave Flash"] === "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false));

这篇关于如何检测浏览器是否支持Flash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆