style.setExpression() (Method)

An MSIE extension for managing style controls.

Availability:

JScript - 5.0
Internet Explorer - 5.0
JavaScript syntax:IEmyStyle.setExpression(aName, anExpression, aLanguage)
Argument list:aNameThe name of the property
anExpressionThe expression to be evaluated
aLanguageThe language to use when evaluating the expression

This is used to set the values for expressions within the style handling complex. You can later retrieve the value of these expressions with the getExpression() method or delete them with the removeExpression() method.

The rules that are used to construct a style are comprised of multiple expressions. You can use this method to assign a new value to an expression within a style item with that value being generated by a callback to a script function.

Given the rule might contain a line such as:

width:200px

the setExpression() method can be applied to the style object containing the rule with that expression like this:

myStyle.setExpression("width:", "callBack()", "JavaScript")

The value of the width parameter would then be defined by the result of calling the callBack() function in the JavaScript context.

The expressions are attached to style properties and can be executed in a variety of languages. The language argument can be one of the following:

See also:Element.getExpression(), Element.removeExpression(), Element.setExpression(), style.getExpression(), style.removeExpression()