You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

is()

Usage

is(condition, trueExpression)

Description
Evaluates the given condition and executes trueExpression if the evaluation result is true. If the expression evaluates to false, NULL is returned. This method is often used in HTML attributes, for example to conditionally select, check, disable form elements.
If used in other scripting contexts and the result is used further, a constructr using if() is probably a better choice.

Example

${is(equal(this.name, request.name), 'selected')}

results in

The string 'selected' is returned if the name of the current object and the requested name are equal.

Search results for "is()"

is()

Evaluates the given condition and executes trueExpression if the evaluation result is true. If the expression evaluates to false, NULL is returned. This method is often used in HTML attributes, for example to conditionally select, check, disable form elements.

If used in other scripting contexts and the result is used further, a construct using if() is probably a better choice.

is(condition, trueExpression)