SWFObject是一個用於在HTML中方面插入Adobe Flash媒體資源(*.swf文件)的獨立、敏捷的JavaScript模塊。該模塊中的JavaScript腳本可以自動檢測PC、Mac機器上各類 主流瀏覽器對Flash插件的支持狀況。它使得插入Flash媒體資源儘可能簡捷、安全。並且它是很是符合搜索引擎優化的原則的。此外,它可以避免您的 HTML、XHTML中出現object、embed等非標準標籤,從而符合更加標準。
1. [代碼]基本使用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>ppt模版http://www.huiyi8.com/ppt/
<title>SWFObject dynamic embed - step 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
2. [代碼]參數定義
<script type="text/javascript">
var flashvars = {
name1: "hello",
name2: "world",
name3: "foobar"
};
var params = {
menu: "false"
};
var attributes = {
id: "myDynamicContent",
name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120",
"9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
3. [代碼]參數定義2
<script type="text/javascript">
var flashvars = false;
var params = {};
var attributes = {
id: "myDynamicContent",
name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120",
"9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>javascript