1. Embed is illegal The <embed> tag is a private tag of Netscape. Although the <embed> tag is widely used, it has not been included in the W3C from HTML3.2, HTML4.0 to XHTML1.0. Pages using the <embed> tag will not pass the W3C validation. 2. Object should be used W3C recommends the <object> tag. Even in XHTML2, <img> will be replaced by <object>. The code to insert the flash using the <object> method is: <object type="application/x-shockwave-flash" data="test.swf" width="200" height="100"> <parm name="movie" value="test.swf /> </object> However, this method cannot display correctly on IE5-IE6/Win (it cannot be played continuously and must be downloaded before it can be played), but it can display correctly on lower versions. Later, the problem of continuous playback was solved by first calling a small flash file and then embedding a large flash file. However, in versions above IE5, the flash sometimes still cannot be displayed. 3. Current temporary measures So what should we do to comply with the standards and display Flash correctly in all browsers? How did the macromedia website pass the W3C validation? Some designers thought of using JavaScript to hide the illegal <embed> tag. <script type="text/javascript"> if (navegiator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] { document.write(''<embed src="test.swf" ... This is currently the better solution. If you must insert flash, use js to call it. This method can deceive the W3C validation program and make the page pass the validation. But it's just "cheating", not really meeting the standards. How does Macromedia do it? See this code: <!-- $RCSfile: FlashDetection2k.pm,v $ $Revision: 1.68 $ : your browser''s accept header indicates you have Flash 6,0,65,0 or better, so you''re OK for this Flash 6 movie, here it comes. --> It adopts a compromise approach: (1). First, JavaScript is used to determine the version of your browser and flash player; (2) Dynamically generate HTML code in the background according to different versions. Simply put, the <object> method is used by default. If the browser cannot handle the MIME type of the object "application/x-shockwave-flash", it inserts the child element <embed>. To be honest, this is similar to using js to hide the <embed> method, which is also a "cheating" method, but it is the most standard and perfect approach that can be done at present. If we want to truly abandon <embed>, we can only wait for IE browser to better support <object>, perhaps until Longhorn comes out. |
<<: MySQL Series II Multi-Instance Configuration
>>: Detailed steps for Spring Boot packaging and uploading to Docker repository
Port Mapping Before the Docker container is start...
When I was in the securities company, because the ...
Table of contents 1. Relationship between parent ...
Recently I want to use goaccess to analyze nginx ...
a href="#"> After clicking the link, ...
Table of contents Intro Nginx Dockerfile New conf...
After the form is submitted, the returned HTML pag...
Deploy the MySQL environment locally (192.168.1.1...
> Deploy MySQL 5.7 cluster master & slave ...
Problem Record Today I was going to complete a sm...
This article shares the specific code of jQuery t...
Today I will introduce two HTML tags that I don’t...
GNU Parallel is a shell tool for executing comput...
Since my local MySQL version is relatively low, I...
Table of contents 1. Rendering 2. Implementation ...