您的位置:首页 > 移动开发 > Objective-C

html标签object和embed的区别

2014-03-12 14:03 495 查看
<!doctype html>

<html lang="en">

<head>

<title>object和embed的区别</title>

</head>

<body bgcolor="#ffffff">

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="900" height="300" id="Column3D" >

<param name="movie" value="XXX.swf" />

<param name="FlashVars" value="&dataURL=Data.xml">

<param name="quality" value="high" />

<embed src="xxx.swf" flashVars="&dataURL=Data.xml" quality="high" width="900" height="300" name="Column3D" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>


</body>

</html>

The code in bold above is the actual code that you need to place in your page to embed a FusionCharts chart.

In the above code, we've

used <OBJECT> and <EMBED> tags to embed the 3D Column Chart (Column3D.swf) within the HTML page.

used &dataUrl=Data.xml under FlashVars parameter to indicate the source of data to chart – Data.xml in this case. This method of indicating data is referred to as dataURL method of providing data.

specified chart width as 900 and chart height as 300.

To display a Flash movie correctly in a browser, HTML page should contain specific tags that specify the Flash movie file to be opened and played. There are two tags which are intended for it: <OBJECT> and <EMBED> tags.

These two tags are required to display a Flash movie in different Internet browsers properly. The <OBJECT> tag is used by Internet Explorer under Microsoft Windows and the <EMBED> tag is used by Netscape Navigator under Microsoft Windows or Mac OS. Each of
these two tags acts in the same way, however using only one tag may cause incompatibility of one of the browsers. To ensure that most browsers will play your Flash movies, you should place the <EMBED> tag nested within the <OBJECT> tag as shown in the example.
ActiveX-enabled browsers will ignore the <EMBED> tag inside the <OBJECT> tag. Netscape and old Microsoft browsers will not recognize the <OBJECT> tag and will use only the <EMBED> tag to load the Macromedia Flash Player. "

结论:

<object> 标签支持IE,<embed>标签支持旧版本的IE和其他的浏览器(如FF、chrome等)。所以在写页面的时候最好是按上面代码中的方式,将embed的内容嵌入到object标签内,这样就可以防止有的浏览器出现不兼容的情况了。

ps:为方遍测试,上面代码中的多媒体文件请自行替换本地文件路径及文件名。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: