FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Mobility
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 17, 2008

Mojax: Mobile Ajax Framework

(Page 2 of 6)

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>

Example 1: Defining CSS content.

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.

Previous Page | 1 Mojax | 2 Mojax Programming Model | 3 User Interface | 4 Styling with CSS; Mojax Script | 5 Data Persistence; Preloading and Caching | 6 Creating Objects Using Prototypes Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK