1. The embed is invalid.
<Embed> labels are private labels of Netscape. Although <embed> labels are widely used, W3C does not include them from html3.2, html4.0 to xhtml1.0. Pages with the <embed> label cannot pass W3C verification.
2. object should be used
W3C recommends the <Object> label. Even in xhtml2, is replaced by <Object>. Use the <Object> method to insertCodeYes:
<Object type = "application/X-Shockwave-flash" Data = "test.swf" width = "200" Height = "100"> <parm name = "movie" value = "test.swf /> </Object>
But this method is not correctly displayed on the IE5-IE6/WIN (cannot play continuously, You have to download to put), in the lower version can be correctly displayed. Later, we used the method of first tuning a small flash file and then embedding a large flash file to solve the problem of continuous playback. However, in ie5 or a later version, flash cannot be displayed.
3. Current temporary measures
So what should I do if I want to correctly display flash in all browsers while complying with the standards? How does the Macromedia Website pass W3C verification?
Some designers think of using JavaScript to hide illegal <embed> labels,
<SCRIPT type = "text/JavaScript"> If (navegiator. mimetypes & navigator. mimetypes ["application/X-Shockwave-flash"] {document. write ('<embed src = "test. SWF "...
This is a good solution. You must plug in flash and use js to call it. This method can fool W3C ValidationProgramTo make the page pass the verification. But it is only "spoofing", not true compliance with standards.
How does Macromedia work? See this Code:
<! -- $ Rcsfile: flashdetection2k. PM, V $ revision: 1.68 $: your browser's accept header indicates you have flash 6, 0, or better, so you're OK for this flash 6 movie, here it comes. -->
It adopts a compromise method:
- (1) first, JavaScript is used to determine your browser version and Flash Player version;
- (2). Generate HTML code dynamically in the background based on different versions.
Simply put, the <Object> method is used by default. If the browser cannot process the object's MIME type "application/X-Shockwave-flash", it inserts the child element <embed>. To put it bluntly, this is similar to hiding the <embed> method with JS, and it is also a "spoofing" method. However, this is the most standard and perfect method that can be achieved at present.
if you really want to discard , you can only wait for IE to provide better support for . Maybe Longhorn will come out.