How can I use javascript/jQuery/etc to detect if Flash is installed and if it isn't, display a div that contains information informing the user that they need to install flash?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- MVC-Routing,Why i can not ignore defaults,The matc
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
jqplugin: http://code.google.com/p/jqplugin/
Use swfobject. it replaces a div with the flash if it is installed. see: http://code.google.com/p/swfobject/
You should also be able to use..
with the swfobject-Plugin.
If
swfobject
won't suffice, or you need to create something a little more bespoke, try this:It works with 7 and 8.
@Drewid's answer didn't work in my Firefox 25 if the flash plugin is just disabled but installed.
@invertedSpear's comment in that answer worked in firefox but not in any IE version.
So combined both their code and got this. Tested in Google Chrome 31, Firefox 25, IE 8-10. Thanks Drewid and invertedSpear :)
You can use navigator.mimeTypes.