Page 157 - DCAP512_WAP_AND_WML
P. 157
Unit 11: Using WML Script
Notes
Table 11.1
Feature WMLScript JavaScript
Semicolons Mandatory Optional
Supports HTML Comments No Yes
Non-escape characters preceded by a backslash No Yes
Names may include $ characters No Yes
Supports global variables Yes Yes
Supports automatic declarations Yes Yes
Supports the generic term number Yes No
Specifies maximum and minimum values for integers Yes No
Supports double-precision floating-point values No Yes
Supports objects No Yes
Supports arrays No Yes
typeof returns an integer a string
Supports for..in No Yes
Supports with No Yes
Supports Libraries Yes No
Supports invalid Yes No
Supports isvalid Yes No
>Supports delete No yes
Supports void No Yes
Supports div Yes No
Supports extern Yes No
Supports pragmas Yes No
Notes URLs are used to refer to the actual WMLScript code in the WML document.
WMLScript is based on ECMAScript (European Computer Manufacturers Association Script),
which is JavaScript’s standardized version. Thus the syntax of WMLScript is very similar to
JavaScript but not fully compatible.
A major difference between JavaScript and WMLScript is that JavaScript code can be embedded
in the HTML markup, whereas WMLScript code is always placed in a file separate from the WML
markup. URLs are used to refer to the actual WMLScript code in the WML document.
LOVELY PROFESSIONAL UNIVERSITY 151