Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Sets an expression for the specified object.
Syntax
object.setExpression( sPropertyName , sExpression [ , sLanguage ] )Parameters
sPropertyName | Required. String that specifies the name of the property to which sExpression is added. | ||||||
sExpression | Required. String that specifies any valid script(jscript, JavaScript, VBSCript) statement without quotations or semicolons. This string can include references to other properties on the current page. Array references are not allowed on object properties included in this script. | ||||||
sLanguage | Optional. String that specifies one of the following values:
|
Return Value
No return value.
Remarks
Use the setExpression method to add expressions to supported Cascading Style Sheets (CSS) attributes and read/write DHTML Properties . To remove expressions set by setExpression , use the removeExpression method.
The following syntax sections show how to set an expression on DHTML Properties and CSS attributes.
The data type of the evaluated expression in the sLanguage parameter must match one of the possible values allowed for the sExpression parameter. If the property or attribute specified by the first parameter requires a string, the data type of the second parameter must be a string. Otherwise, the second parameter is evaluated prior to invoking setExpression , causing the expression to be set to the result of the evaluation.
Use the uniqueID property of an object in an expression to refer back to the object. Using uniqueID is an alternative to specifying an id for expressions that use an object reference.
The cssText property is a unique property that is not compatible with the dynamic properties implementation. Do not use cssText with any dynamic property methods.
The following examples illustrate common problems encountered with the sExpression parameter in setExpression . The sExpression appears valid, but may not be.
Examples
The following examples use the setExpression method to change the width of a blue box. In each example, the width of the blue box is equal to the sum of the values of the first two text boxes. When a value in one of the text boxes changes, the width of the blue box recalculates.This example shows the HTML implementation of setExpression .
<INPUT TYPE=text ID=oBox1 value=40>The sum of the values in these two text boxes determines the width<BR>This example uses the uniqueID property and the setExpression method to update the innerText property of a table row.
<SCRIPT>
Standards Information
There is no public standard that applies to this method.
Applies To
|
A , ACRONYM , ADDRESS , APPLET , AREA , B , BDO , BIG , BLOCKQUOTE , BODY , BR , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , currentStyle , CUSTOM , DD , DEL , DFN , DIR , DIV , DL , DT , EM , EMBED , FIELDSET , FONT , FORM , hn , HR , I , IFRAME , IMG , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=hidden , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , INS , KBD , LABEL , LEGEND , LI , LISTING , MARQUEE , MENU , NOBR , OBJECT , OL , OPTION , P , PRE , Q , RT , RUBY , runtimeStyle , S , SAMP , SELECT , SMALL , SPAN , STRIKE , STRONG , style , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TFOOT , TH , THEAD , TR , TT , U , UL , VAR |
Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |