Page 154 - DCAP512_WAP_AND_WML
P. 154

WAP & WML




                    Notes          WML Script resides  within the high-level applications layer of the WAP structure and adds
                                   capabilities for swifter, more advanced and interactive logical operations between the mobile
                                   device and server.

                                       !
                                     Caution  WML Script code can be written in normal text files.

                                   11.1.1 The Rules of WML Scripts


                                   What is Scripting?

                                   Scripting adds “behavioral” capabilities to the device to enhance application performances and
                                   the user experience.
                                   Scripting adds capabilities like the following:

                                      Validating user input
                                      Accessing device capabilities and processing alerts
                                      Enabling device extensions.

                                   Scripting enables local processing on the device and eliminates needless “roundtrip” messages
                                   over the air link to the server, and thus

                                      Speeds up the user experience
                                      Reduces connection time costs
                                      Enables faster information input and display

                                   WMLScript Basics

                                   WML Script is

                                      Inherited from JavaScript 1.1 and ECMA Script
                                      Modeled for limited capacity devices

                                      Procedural rather than object oriented
                                      Uses 32 bit integer
                                      Is referenced from WML, not contained within it

                                      Is compiled to binary  to run  on WAP devices (compiling  is handled  by the gateway
                                       server)

                                   Script Syntax Rules

                                   WML Script follows these syntax rules.
                                      Script is case sensitive

                                      White space is ignored
                                      Blocks are enclosed in brackets “{}”.





          148                               LOVELY PROFESSIONAL UNIVERSITY
   149   150   151   152   153   154   155   156   157   158   159