Article introduction of Wulin.com (www.vevb.com): A little usage of flash in xhtml.
1. Traditional FLASH writing method cannot pass the test
2. Traditional FLASH writing method will have dotted borders in IE7 to affect vision
3. The traditional FLASH writing method is a large piece of code for each writing, which is not conducive to the application of displaying multiple FLASH on the same page.
Here is a method that can be converted to JS and then called:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN >
<html xmlns= lang=utf-8>
<head>
<title></title>
<meta http-equiv=Content-Type content=text/html; charset=utf-8 />
<script type=text/javascript>
function flash (ur ,w ,h ){
document.write('<object classid=clsid:D27CDB6E-AE6D-11CF-96B8-444553540000 id=obj1 codebase=#version=6,0,40,0 border=0 width='+w+' height='+h+'>');
document.write('<param name=movie value='+ur+'>');
document.write('<param name=quality value=High>');
document.write('<embed src='+ur+' pluginspage= type=application/x-shockwave-flash name=obj1 width='+w+' height='+h+'>');
document.write('</object>');
}
</script>
</head>
<body>
<script type=text/javascript>flash('http://client.joy.cn/flvplayer/451974_1.swf','100','80');</script>
<br />
<br />
<script type=text/javascript>flash('http://www.flash8.net/uploadflash/68/flash8net_67466.swf','500','375');</script>
</body>
</html>
Advantages (corresponding to the disadvantages of traditional writing methods mentioned above):
1. Pass the test
2. There is no dotted border for IE
3. Unlimited call. If you save the JS code in the head separately as a JS file and call it, it will save a lot of code. Even if you simply calculate it in numbers, the code that calls JS is simpler than the insertion code of FLASH itself. Of course, the premise is that there is not only one place to insert FLASH in your website.