Appcelerator supports both a declarative and unobtrusive approach for building rich web applications.
Web Expression Language
The Web Expression Language allows you to turn standard HTML elements into dynamic components by using simple expressions. It seamlessly integrates the three primary tasks for interaction design:
- Event handling
- DOM Manipulation
- Ajax
Here’s an example:
1
2
3
| <div on="click then r:login.request and set[color=red]">
Click Me
</div> |
When the DIV is clicked, a remote Ajax request is sent (login.request) and the DIVs text color will change to red. Pretty cool.
Unobtrusive Javascript
Appcelerator also supports an unobtrusive style of web programming. This approach allows you to keep your markup clean and to easily divide the workload between HTML and Javascript programmers.
Here’s an example:
1
2
3
4
5
6
7
| <div>
Click Me
</div>
<script>
$('my_div').on("click then r:login.request and set[color=red]");
</script> |
No matter which approach you use, Appcelerator will enable you to build rich apps faster and with less code.