Mojax Programming Model
Like browser-based Ajax applications, the Mojax application UI consists of visual elements arranged within a screen. The UI elements are defined using Mojax XML tags; for example:
<moblet default="main"> <screen id="main" layout="vertical"> <textbox width="100%" halign="center"> Hello World!</textbox> </screen> </moblet>
With the visual elements defined, you specify various attributes such as color, borders, and margins using Cascading Style Sheets (CSS). Example 1 shows one approach for defining CSS content using a <style> tag.
<moblet default="main"> <style> screen { color: #483D8B; background-color: #DCDCDC; font-size: medium; } </style> <screen id="main" layout="vertical"> <textbox width="100%" halign="center">Hello World!</textbox> </screen> </moblet>
The final aspect of developing Mojax applications is to tie together application logic and the interaction among visual elements using Mojax script, an implementation of the ECMAScript-262 Standard (the same standard JavaScript is based on). While the DOM objects available to Mojax developers are unique to the Mojax framework, you will have little trouble with Mojax if you are familiar with HTML DOM.