Home Web Front-end JS Tutorial Multiple methods to determine whether the client browser has the Flash plug-in installed_javascript skills

Multiple methods to determine whether the client browser has the Flash plug-in installed_javascript skills

May 16, 2016 pm 06:21 PM
flash plug-in Browser

Commonly used methods:

Copy code The code is as follows:


[code]
Dynamic loading.
[code]
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6 ,0,0,0"
WIDTH="120" HEIGHT="60" id="468x60" ALIGN="" VIEWASTEXT>





<script> <br>function addFlash() { <br>mFlash.movie="http: //www.jb51.net/images/ad/WIBU.swf"; <br>mFlash.Play(); <br>} <br></script>

There are many detections The PLUGIN method, because you cannot solve this problem with just one method, there are so many methods
1. Built-in detection
IE on NN and MAC cannot use the following detection, only on WIN IE can
1. Install on demand
If the install on demand option in IE's Tools - Internet Options - Advanced - Browsing is enabled, Flash will be downloaded from the MS website when the browser needs it. Player ActiveX control
If it does not take effect and you enter the webpage directly without installing PLUGIN, you will see a small ICON like a cracked square. Clicking it can also take you to install it
2. In HTML The classid and codebase attributes in the OBJECT tag
classid is the identification of ActiveX control, for example, FLASH PLAYER is:
clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codebase is the address to download the plug-in, for example FLASH4 (if the browser detects that the number after version is lower than the version you already have, it will not install it):
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab# version=4,0,2,0
These HTML tags will be automatically added when you insert them into PUBLIC or DW in FLASH
The browser will detect these tags when executing them
2. Use SCRIPT This method of detection
is to get rid of the limitations of the previous method, such as the behavior called "Check Plug-in" in DW.
This method still cannot be used on some machines that cannot execute SCRIPT, such as Versions before IE4.5 on MAC, IE on WIN31.
There are also some users who turn off SCRPIT execution.
3. Use FLASH to detect
If the user doesn’t even execute SCRPIT, they can only use this trick. This is also the method used by MM herself.
Make a detection HTML, put a SWF in it, with only one sentence GetURL ("your real page")
At the same time, put of the HTML ="10; URL="Page where FLASH is not installed">
If the SWF does not take you to the real page within 10 seconds, the detected HTML will take you to the page where FLASH is not installed
4. The last method is to let users choose
This is also the most common. Many websites have an entrance page, and below there is a small ICON for installing PLUGIN
Copy code The code is as follows:






<script> <br>//自己总结的 <br>//IE中判断是否安装插件 <br>var swf; <br>function IE_Flash() <br>{ <br>try <br>{ <br>var swf=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); <br>alert("已安装插件"); <br>} <br>catch(e) <br>{ <br>alert("没有安装插件"); <br>} <br>} <br>//FireFox,Chrome中判断是否安装插件 <br>function FF_or_Chrome_Flash() <br>{ <br>var swf=navigator.plugins["Shockwave Flash"]; <br>(swf)?alert("已安装插件"):alert("没有安装插件"); <br>} <br></script>
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to customize the resize symbol through CSS and make it uniform with the background color? How to customize the resize symbol through CSS and make it uniform with the background color? Apr 05, 2025 pm 02:30 PM

The method of customizing resize symbols in CSS is unified with background colors. In daily development, we often encounter situations where we need to customize user interface details, such as adjusting...

How to achieve gap effect on the card and coupon layout with gradient background? How to achieve gap effect on the card and coupon layout with gradient background? Apr 05, 2025 am 07:48 AM

Realize the gap effect of card coupon layout. When designing card coupon layout, you often encounter the need to add gaps on card coupons, especially when the background is gradient...

Why does negative margins not take effect in some cases? How to solve this problem? Why does negative margins not take effect in some cases? How to solve this problem? Apr 05, 2025 pm 10:18 PM

Why do negative margins not take effect in some cases? During programming, negative margins in CSS (negative...

How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? Apr 05, 2025 pm 10:33 PM

Using locally installed font files in web pages Recently, I downloaded a free font from the internet and successfully installed it into my system. Now...

The text under Flex layout is omitted but the container is opened? How to solve it? The text under Flex layout is omitted but the container is opened? How to solve it? Apr 05, 2025 pm 11:00 PM

The problem of container opening due to excessive omission of text under Flex layout and solutions are used...

How to obtain real-time application and viewer data on the 58.com work page? How to obtain real-time application and viewer data on the 58.com work page? Apr 05, 2025 am 08:06 AM

How to obtain dynamic data of 58.com work page while crawling? When crawling a work page of 58.com using crawler tools, you may encounter this...

How to use CSS and Flexbox to implement responsive layout of images and text at different screen sizes? How to use CSS and Flexbox to implement responsive layout of images and text at different screen sizes? Apr 05, 2025 pm 06:06 PM

Implementing responsive layouts using CSS When we want to implement layout changes under different screen sizes in web design, CSS...

Why does a specific div element in the Edge browser not display? How to solve this problem? Why does a specific div element in the Edge browser not display? How to solve this problem? Apr 05, 2025 pm 08:21 PM

How to solve the display problem caused by user agent style sheets? When using the Edge browser, a div element in the project cannot be displayed. After checking, I posted...

See all articles