WMLScript

from Wikipedia, the free encyclopedia

WMLScript is a scripting language that can be used to embed executable scripts in WML pages. It is largely based on JavaScript , but has special elements and methods with which, for example, WML variables can be read and changed.

WMLScript is designed for the low bandwidth of mobile systems. WMLScript is not used like JavaScript to design attractive pages, but rather it is used to check the entered data directly on the client , which makes an error message from the server unnecessary. Another application is the WTA protocol ( Wireless Telephony Applications ), with which functions of the cell phone - for example calling a number - can be addressed. The functions of this protocol are called with WMLScript.

processing

WMLScripts are (as a rule) not parsed by the mobile client , as this is too complex for the limited hardware of the client and also increases the transfer volume. Rather, a gateway is used which receives the WML document and the associated script from the server . The gateway encodes the data in a special byte code that is intended to reduce the amount of transmission. The coded data is now transmitted to the client.

Conversely, the gateway receives the data from the client, decodes them and sends the uncoded data to the server.

construction

WMLScript parts are either noted directly within a WML file or stored in an external file. A WMLScript function can be called from the WML part or dateinamen.wml#funktion()addressed directly with.

The syntax is similar to that of JavaScript. Instructions must end with a semicolon, several instructions can be combined in one instruction block (identified by {and }). Variables (in contrast to JavaScript) have to be declared but not initialized. Uninitialized variables contain an empty string . As in JavaScript, variables are not typed .