如何检查浏览器是否支持Flash? [英] How to I check to see if the browser supports flash?

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

问题描述

如果客户端浏览器没有启用Flash,我有一个Flash横幅,我想用一个静态图片替换。



我想知道如果我可以做这与PHP - 或者如果有人知道的一个好方法

感谢

解决方案

你只能用javascript来做到这一点,使用 navigator.plugins 界面。例如:

  if(typeof navigator.plugins ['Shockwave Flash']!=='undefined'){}  code> 

然而,一个更加可靠的解决方案,不需要任何javascript就可以简单的将你的后备镜像放在闪存的后面对象,如果闪光灯不亮,图像将显示。您可以将< img /> 标记置于flash < object /> 内,或者您也可以在对象上放置一个CSS背景图像。


I have a flash banner that I want to replace with a static image if the clients browser doesn't have flash enabled.

I was wondering if I can do this with php - or if anyone knows of a good method

Thanks

解决方案

You can only do this with javascript, using the navigator.plugins interface. Something like:

if(typeof navigator.plugins['Shockwave Flash']!=='undefined'){ }

However, a far more reliable solution that doesn't require any javascript would be simply to position your fallback image "behind" the flash object so that if the flash doesn't turn up, the image will show through. You can either put an <img/> tag inside the flash <object/> or you can put a CSS background-image on the object.

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

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