WMLScript Interview Preparation Guide
Download PDF

WML Interview Questions and Answers will guide us now that WMLScript is the dialect of JavaScript used for WML pages and is part of the Wireless Application Protocol (WAP). WMLScript is a client-side scripting language and is very similar to JavaScript. Just like JavaScript WMLScript is used for tasks such as user input validation, generation of error message and other Dialog boxes etc. So learn WML with the help of this WML Script Interview Questions with Answers guide

4 WMLScript Questions and Answers:

1 :: What is WML (WMLScript)?

WMLScript is a subset of the JavaScript scripting language designed as part of the WAP standard to provide a convenient mechanism to access mobile phone’s peripheral functions.

2 :: Can I use embedded WMLScript in my WML pages?

No, you cannot use embedded WMLScript in your WML pages. You need to place your scripts in seperate files and reference them from your WML decks. Check the WMLScript tutorial to see how it's done.

3 :: When should I use WMLScript?

The purpose of WMLScript is to provide client-side procedural logic. It is based on ECMAScript (which is based on Netscape’s JavaScript language), however it has been modified in places to support low bandwidth communications and thin clients. The inclusion of a scripting language into the base standard was an absolute must. While many Web developers regularly choose not to use client-side JavaScript due to browser incompatibilities (or clients running older browsers), this logic must still be replaced by additional server-side scripts. This involves extra roundtrips between clients and servers which is something all wireless developers want to avoid. WMLScript allows code to be built into files transferred to mobile client so that many of these round-trips can be eliminated. When you need to add interactivity to your WML-pages, such as user input, you should use WMLScript.

4 :: Which functions are available in the WMLscript Lang library?

The functions in this section are accessed by Lang.functionName abs(number) returns the absolute value of number min(number1,number2) returns smallest of number1 and number2, or number1 if equal min(number1,number2) returns largest of number1 and number2, or number1 if equal parseInt(string) returns the integer value of string parseFloat(string) returns the floating point value of string isInt(string) returns true if string can be converted to an integer isFloat(string) returns true if string can be converted to a floating point value maxInt() returns the maximum supported integer value