Sets or retrieves the source of the data for data binding.
dhtml语法
HTML | <ELEMENT DATASRC
= sID... >
|
---|
Scripting | object.dataSrc [ = sID ] |
---|
DHTML可能的值
sID | String that
specifies or receives the identifier of the data source. |
The property is read/write.
The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
tabular and single-valued data consumers use the datasrc property to specify a binding. the property takes a string that corresponds to the unique identifier of a data source object (dso) on the page. the string must be prefixed by a number sign (#).
when the datasrc property is applied to a tabular data consumer, the entire data set is repeated by the consuming elements.
when the datasrc property is applied to a table, any contained single-valued consumer objects that specify a datafld property are repeated for each record in the supplied data set. to complete the binding, the binding agent interrogates the enclosing table for its data source. a tabular data consumer contained within another tabular data consumer (table) must specify an explicit datasrc.
DHTML代码范例
In this example, a text box is bound to the customer_name field of a data source object with an ID of "customer". Because the text box is located within a data-bound table, the text box is repeated to display each of the records provided by the data source.
<TABLE DATASRC="#customer">
<TR><TD><INPUT TYPE=TEXTBOX DATAFLD="customer_name"><TD><TR>
</TABLE>
是否符合公共标准
There is no public standard that applies to this property.
Applies To
|
A,
APPLET,
BUTTON,
DIV,
FRAME,
IFRAME,
IMG,
INPUT type=button,
INPUT type=checkbox,
INPUT type=hidden,
INPUT type=image,
INPUT type=password,
INPUT type=radio,
INPUT type=text,
LABEL,
MARQUEE,
SELECT,
SPAN,
TABLE,
TEXTAREA |
|
更多语法参考
Introduction to Data Binding