====== Entourage Expressions ====== Entourage Expressions provide web developers with a domain specific language (DSL) for browser-based rich web applications. Expressions provide a natural language syntax for common RIA programming tasks, such as: * DOM Manipulation * Event handling * Server-side data access (powered by [[mq:start|Entourage MQ]]) ===== What are 'Expressions'? ===== Entourage Expressions are composed of two parts, a condition and an action: on="[condition] then [action]" An [[expressions:actions|action]] is any sort of action that can be taken on or by a given element, such as adding a CSS class, executing a visual effect, or changing the contents of an element. A [[expressions:conditions|condition]] is a trigger for that action, and can be anything from a mouse click to the results of a remote service call. Expressions can contain multiple conditions, and multiple actions can be taken when a condition is met. The following is a simple example of a web expression in action. In this example, the expression is declared inline with markup: **Live Example**

Click To Highlight Me

**Source Code**

Click To Highlight Me

There are a number of different conditions and actions available in Expressions. Read through our [[expressions:conditions|condition]] and [[expressions:actions|action]] references for more details and usage instructions. ===== How do I use expressions? ===== There are three ways to declare web expressions - inline in HTML, using the ''App.on'' function, and the jQuery plugin function ''$().on''. Examples of using each can be found below: **Live Example**
Box 1
Box 2
Box 3
**Source Code**
Box 1
Box 2
Box 3
In the preceding example, a message action was executed when the button is clicked. The three boxes subscribe to the message ''l:click'', and when it is received, they execute a highlight effect on themselves. This example is just a tiny fraction of the syntactical elements available to you in Entourage Expressions - make sure to check out the reference pages for [[expressions:conditions|conditions]], [[expressions:actions|actions]], and [[expressions:api|the JavaScript API]] to sample the full power of Entourage Expressions. ===== Expression Syntax ===== In web expressions, there are certain keywords that can be used to modify conditions and actions, like ''or'', ''and'', and ''else'' - refer to the action and condition documentation for examples and further explanation. Also, some conditions and actions take parameters, and parameters are usually passed in the format ''[=] then [=]'' **Live Example**
I get toggled by the button! You can also click me to make me EXPLODE!!!!
**Source Code**
I get toggled by the button! You can also click me to make me EXPLODE!!!!