object 标签 -- 定义网页中嵌入除图片外的多媒体


  • object标签是成对出现的,以

<object>

  • 开始,

</object>

  • 结束
  • 使用object标签可以在网页中嵌入各种多媒体,例如Flash,Java Applets,MP3,QuickTime Movies等
  • param标签通常配合object标签一同使用
  • object标签内除了param标签外,其它的内容将在浏览器不支持objcet标签时显示
  • 在网页中嵌入图像,请使用img标签
  • object可以完全代替标准不赞成使用的applet,embed,bgsound标签
  • 引用网址:http://www.dreamdu.com/xhtml/tag_object/
  • 属性

archiveborderclassid

  •  -- 关联一个应用程序,执行嵌入内容的应用程序在windows系统中的唯一id(不能改变此id,否则程序将出现异常),例如

clsid:D27CDB6E-AE6D-11cf-96B8-444553540000codebase

  •  -- 为相对路径提供基URL,IE浏览器通常将此属性中的内容定义为运行嵌入内容所要加载的插件,例如

http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0codetype

application/javaapplication/x-shockwave-flashdeclare

  •  -- 声明没有实例化的嵌入内容,此内容通常在加载后可以使用,或者当嵌入内容的某些参数将使用其它嵌入内容时

declaredata

  •  -- 嵌入内容的URL,可以是根据codebase属性的相对路径

heighthspace

  •  -- 嵌入内容水平方向的空白,应使用CSS margin代替

standby

  • tabindex -- 使用"Tab"键的遍历顺序

usemap

  • viewastext -- 阻止一些可视化工具,例如Microsoft FrontPage或者Visual InterDev在设计页面时运行object内的组件

vspace

  •  -- 嵌入内容垂直方向的空白,应使用CSS margin代替

width

  • object:物体,对象

object标签示例

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
        您的浏览器不支持Flash,请点击<a href="http://www.macromedia.com/go/getflashplayer">下载</a>。
        <param name="movie" value="/1.swf" />
        <param name="quality" value="high" />
</object>

<
object
classid
=
"
clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
"
codebase
=
"
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0
"
>
<
a
href
=
"
http://www.macromedia.com/go/getflashplayer
"
>
</
a
>
。
<
param
name
=
"
movie
"
value
=
"
/1.swf
"
 
/>
<
param
name
=
"
quality
"
value
=
"
high
"
 
/>
</
object
>

常用属性:

属性 
        Common -- 一般属性 
        archive -- 包含多个使用逗号(,)分割的Java类或外部资源,用于增强applet的功能,定义applet代码 
        border -- 边框 
        classid -- 关联一个应用程序,执行嵌入内容的应用程序在windows系统中的唯一id(不能改变此id,否则程序将出现异常),例如 
            clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 -- Flash 
        codebase -- 为相对路径提供基URL,IE浏览器通常将此属性中的内容定义为运行嵌入内容所要加载的插件,例如 
            http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 -- Flash 
        codetype -- 嵌入内容的MIME类型,例如 
            application/java -- Java 
            application/x-shockwave-flash -- Flash 
        declare -- 声明没有实例化的嵌入内容,此内容通常在加载后可以使用,或者当嵌入内容的某些参数将使用其它嵌入内容时 
            declare -- 声明 
        data -- 嵌入内容的URL,可以是根据codebase属性的相对路径 
        height -- 嵌入内容的高度,单位像素 
        hspace -- 嵌入内容水平方向的空白,应使用CSS margin代替 
        standby -- 文档加载时显示的文本信息 
        tabindex -- 使用"Tab"键的遍历顺序 
        usemap -- 定义图像点击区域 
        viewastext -- 阻止一些可视化工具,例如Microsoft FrontPage或者Visual InterDev在设计页面时运行object内的组件 
        vspace -- 嵌入内容垂直方向的空白,应使用CSS margin代替 
        width -- 嵌入内容的宽度,单位像素 
    object:物体,对象 

Following is an example of the object tag: 

<OBJECT 
  classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
  width="200" height="200"> 
  <PARAM name="code" value="Applet1.class"> 
</OBJECT> 
The classid Attribute 

The classid attribute identifies which version of Java Plug-in to use. 

The example shown below is the most commonly used form of the classid attribute. This example instructs Internet Explorer to use the latest installed version of Java Plug-in. 

classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
Following is an alternative form of the classid attribute: 

classid="clsid:CAFEEFAC-xxxx-yyyy-zzzz-ABCDEFFEDCBA" 
In this form, "xxxx", "yyyy", and "zzzz" are four-digit numbers that identify the specific version of Java Plug-in to be used. 

For example, to use Java Plug-in version 1.5.0, you specify: 

classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA" 
The codebase Attribute 

You use the optional codebase attribute to specify if and how to download the JRE. 

The codebase attribute has two forms: 

codebase=<URL> 

With this form, if the JRE specified by the classid attribute is not installed locally, then the user is prompted to download the JRE from the URL specified. 
codebase=<URL>#Version=major,minor,micro,update 

With this form, if the version of the JRE specified in the codebase attribute is greater than the version of the JRE specified by the classid attribute, then the user is prompted to download the JRE from the URL specified. 
Following is an example of how to use the codebase attribute to set up automatic downloads from the Sun Java Web site: 

<object 
  classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
  width="200" height="200" 
  codebase="http://java.sun.com/products/plugin/autodl/ 
           jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"> 
  <param name="code" value="Applet1.class"> 
</object> 
Note: In this example the codebase=http://java.sun.com ... line is broken for readability. In the actual HTML file it would be one long line. 

Sun has packaged each version of the JRE installer in Microsoft cabinet (.cab) file format