SlideShare a Scribd company logo
WML Script 
CS 486 
Global Knowledge 
Networks 
Instructor: Dr.V.Juggy 
Presented By: Shanti Katta
Objective 
What is WMLScript? 
What is WMLScript used for? 
WMLScript Vs JavaScript 
How to call WMLScript? 
Pragmas 
WMLScript language syntax 
Variables, naming rules, data types and operators 
WMLScript standard libraries 
Example 
Summary
What is WMLScript? 
WMLScript is the client-side scripting 
language used in WML pages. 
WMLScript is a light version of JavaScript. 
WMLScripts are not embedded in the WML 
pages. WML pages only contain references to 
script URL’s. 
WMLScript is compiled into byte code on 
the server before it is sent to the WAP 
browser.
What is WMLScript? 
(Cont…) 
WMLScript is part of the applications layer of 
the WAP architecture. 
WMLScript is an event-based language used to 
add interaction to documents. 
WMLScript has a weak type definition. 
They contain collection of related functions into 
source code files which are hosted on server and 
accessed through URL’s.
What is WMLScript used 
for? 
WMLScript is used to validate user input. 
WMLScript is used to generate message boxes 
and dialog boxes locally, to view error messages 
and conformations faster. 
WMLScript is used to access facilities of the 
user agent. 
WMLScript enhances WML by adding local 
intelligence to distributed applications.
What is WMLScript used for? 
(Cont…) 
WMLScript can be used to add procedural 
logic to WAP devices, either as part of WML 
documents, or as a standalone tool in 
independent applications. 
WMLScript can be used to add interaction 
and dynamic code to documents. 
WMLScript includes functions which are 
called if a task calling the functions has been 
linked to WML events and the event occurs.
WMLScript Vs JavaScript 
WML contains references to the URL address of a 
WMLScript function, whereas JavaScript functions are 
normally embedded in HTML code. 
WMLScript units have to be compiled into binary 
WMLScript code before they can be executed in a WAP 
device. This means that WMLScript Virtual Machine 
(VM) has to be included on the browser that executes the 
script. 
WMLScript makes heavy use of libraries than 
JavaScript. 
Call-by-address is not supported by JavaScript. It 
supports only call-by-value.
WMLScript Vs JavaScript 
(Cont…) 
Feature WMLScript JavaScript 
Supports objects No Yes 
Supports arrays No Yes 
Typeof returns Integer String 
Supports Libraries Yes No 
Supports extern Yes No 
Supports invalid Yes No 
Supports for..in No Yes 
Supports pragmas Yes No 
Supports delete No Yes
WMLScript Vs JavaScript 
(Cont…) 
Feature WMLScript JavaScript 
Semicolons Mandatory Optional 
Supports HTML Comments No Yes 
Non-escape characters 
No Yes 
preceded by a backslash 
Names may include ‘$’ No Yes 
Supports global variables Yes Yes 
Supports auto declarations Yes Yes 
Supports the genericterm 
Yes No 
number 
Specifies max and min values Yes No
How to call WMLScript? 
WMLScripts are not embedded in WML pages. The WML pages 
only contain references to script URL’s. 
In the example below, a card is created where you enter a URL, 
select the ‘go’ label, and then go off to the specified URL. 
<?xml version=“1.0”?> 
<!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” 
“http://www.wapforum.org/DTD/wml_1.1.xml”> 
<wml> 
<card id=“no1” title=“Go to URL”> 
<do type=“options” label=“Go”> 
<go href=“check.wmls#go_url(‘my_url’)”/> 
</do>
How to call WMLScript? 
(Cont…) 
<p> 
Enter a URL: 
<input type=“text” name=“my_url”/> 
</p> 
</card> 
</wml/> 
The red line above contains a reference to a WMLScript. The script is 
in a file called check.wmls, and the name of the function is go_url. 
The go_url function sends you to the URL you entered. The function 
also checks if you omitted the “http://” part in the URL.
How to call WMLScript? 
(Cont…) 
Here is the WML page called : 
check.wmls 
Extern function go_url (the_url) 
{ 
if (String.find(the_url , “http://”) < 0 ) 
{ 
the_url = “http://” + the_url; 
} 
WMLBrowser.go (the_url); 
} 
NOTE: The extern keyword is used to allow other functions access 
to this function, or WML events outside the .wmls file.
WMLScript Bytecode 
Interpreter 
WMLScript must be compiled into binary form before it 
can be interpreted by the WMLScript bytecode 
interpreter. WMLScript compiler encodes one 
WMLScript compilation unit into WMLScript bytecode. 
Interpreter Architecture 
call http://www.host.com/script#myFunc(“Test”,12) 
WMLScript 
Libraries 
Functions 
Interpreter WMLScript 
Bytecode 
Functions 
….. 
myFunc() 
State 
IP Operand 
Stack 
Call Stack Variables
Pragmas… 
WMLScript is a compiled language and uses 
Compilation Units (Collection of functions) and Pragmas, 
which are contained in them. 
Pragmas are statements that are interpreted by the 
compiler. 
WMLScript uses pragmas to identify other compilation 
units that it uses. 
All pragmas are optional and appear at beginning of 
compilation unit, before any function declarations. 
There are 3 WMLScript pragmas :-
Access Control Pragmas 
A WMLScript computation unit can protect its content 
by using a special access control pragma, which is 
examined before any externally-defined functions are 
executed. 
access 
Syntax: use 
access 
Domain domain_name 
Path path_name 
Domain domain_name path path_name 
One can restrict access to specific domains, specific 
paths, or their combinations. Path names can be 
absolute or relative, which are always converted to 
absolute later.
Meta Pragmas 
Meta pragmas convey information to different entities in 
WAP environment. 
meta 
Syntax: 
Use meta 
Meta elementName “elementvalue” 
http equiv elementName “elementvalue” 
User agent elementName 
“elementvalue” 
Compilation units may contain more than 1 meta 
pragma, but no more than 1 meta pragma of same type.
Meta Pragmas(Cont…) 
Name information is intended for origin servers, and 
may contain such information as copyright assignments. 
http equiv information is used to control HTTP headers. 
It is used to specify HTTP header information to 
mediating servers that transfer compilation unit. 
User agent information is reserved for passing 
information to specific WAP user agents to implement 
WAP extensions
URL Pragmas 
To access a function outside of a compilation unit, one 
must include a pragma that associates the URL of the 
other compilation unit, an internal identifier, which 
can be used to access external functions. 
url 
Syntax: use url Identifier string_literal 
The use url pragma specifies the location (URL) of the 
external WMLScript resource and gives it a local 
name.
URL Pragmas(Cont…) 
For example: 
use url DocJS “http://www.docjavascript.com/mywml”; 
function divide(nom, denom) 
{ 
if (denominator = = 0) return invalid; 
return DocJS#mydiv(nom, denom); 
} 
The use url pragma specifies a URL to the compilation 
unit. Once the file is found, the function call 
DocJS#mydiv() triggers the loading of external 
compilation unit http://www.docjavascript.com/mywml.wmlsc.
WMLScript Language 
Syntax 
WMLScript syntax is based on the ECMAScript. 
Following points summarize some basic syntactical 
features: 
The smallest unit of execution in WMLScript is a 
statement and each statement must end with a semicolon(;). 
WMLScript is case-sensitive. 
Comments can either be single-line(starting with //) or 
multiline (bracketed by /*…*/). 
A literal character string is defined as any sequence of 
zero or more characters enclosed within double(“ “) or 
single(‘ ‘).
WMLScript Language 
Syntax(Cont…) 
New variables are declared using var keyword. 
Boolean literal values correspond to true and false. 
WMLScript is a weakly-typed language. 
Internally, the following data types are supported: 
Boolean, Integer, Floating-point, String, and 
Invalid. 
Includes assignment, arithmetic, logical, string, 
comparison, and array operations. 
Includes control statements like if-else, for loop, 
while loop, break and continue statements.
Naming Rules 
Identifiers within WMLScript can be used to name 
variables, functions and pragmas. 
When managing names, WMLScript differentiates 
between three name spaces: 
function names 
function parameters and variables 
pragmas 
It is allowable to use the same name for a function and 
variable. Like most languages, WMLScript has a list of 
reserved words like access, agent, meta, url, use, etc.
Variables and Data Types 
WMLScript is a weakly typed language. No type 
checking is done at compile-time and no variable types 
are declared. Four types of values can be declared for 
WMLScript variables: 
integer, floating point, string and Boolean. 
The fifth type is invalid, which is reserved for cases 
when the type cannot be determined. This may happen in 
type conversions or when dividing by zero. 
Because the data types are only supported internally, 
they are not defined during the declarations, but the type 
is determined during the execution of the function. 
WMLScript converts between the types if necessary.
Operators 
WMLScript supports 45 arithmetic, assignment, and 
logical operators. 
Arithmetic: Provides basic math in WMLScript, 
including addition, subtraction, multiplication, floating 
point and integer division. 
Assignment: Allows assignment of a value to a variable, 
but WMLScript also supports assignment with operators. 
Logical: WMLScript supports logical operations AND, 
OR and NOT. If WMLScript evaluates the first operand 
to be INVALID, the expression is INVALID.
WMLScript Standard 
Libraries 
While WMLScript does not support the creation of new 
objects via object-oriented programming, it does provide six 
“pre-built” libraries. 
Lang – This library contains a set of functions that are 
closely related to the WMLScript language core. Included in 
this library are functions for data type manipulation, absolute 
value calculations, and random number generation. 
Function Description 
abort() Aborts a WMLScript and returns a message to the 
caller 
Abs() Returns the absolute value of a number. 
characterSet() Returns the character set supported by WMLScript 
interpreter.
WMLScript Standard 
Libraries(Cont…) 
exit() Exits a WMLScript and returns a message to the caller. 
float() Returns true if floating-point numbers are supported. 
isFloat() Returns true if specified value can be converted into float. 
max() Returns the largest value of two numbers. 
maxInt() Returns the maximum possible integer value. 
random() Returns random integer between 0 and specified number. 
seed() Initializes random number generator with a number. 
Note: Since the Lang library contains some functions that 
we would expect to find in a Math library, the Lang 
library has a little misleading name. But it is called the 
Lang Library because it contains functions that are 
closely related to the core of WMLScript engine.
WMLScript Standard 
Libraries(Cont…) 
Float – The Float library is optional and is only supported 
on those clients who have floating-point capabilities. 
Typical functions provided are: 
Function Description 
ceil() Returns the nearest integer not smaller than given no. 
floor() Returns the nearest integer not longer than given no. 
int() Returns the integer part of a specified number 
maxFloat() Returns the largest possible floating-point number. 
minFloat() Returns the smallest possible floating-point number. 
pow() Raises a no. to the power of a second number. 
round() Returns the nearest integer to a specified number. 
sqrt() Returns the square root of a specified number.
WMLScript Standard 
Libraries(Cont…) 
String – The String library contains a set of functions for 
performing string operations. 
Function Description 
charAt() Returns a character is placed in a specified position. 
compare() Compare two strings, and returns an integer. 
elementAt() Separates a string into elements and returns element. 
elements() Returns the frequency of a specified value in a string. 
squeeze() Reduces all white spaces to single spaces. 
find() Returns the position of a substring in a string. 
format() Formats a value, and returns result. 
trim() Returns a string without leading and trailing spaces. 
toString() Creates a string from a number, and returns the 
result.
WMLScript Standard 
Libraries(Cont…) 
URL – This library contains a set of functions for handling 
both absolute URLs and relative URLs. Typical functions: 
Function Description 
escapeString() Replaces special char’s in URL with escape 
sequence. 
getFragment() Returns the fragment in a URL. 
getHost() Returns the host specified in a URL. 
getParameters() Returns parameters in last path segment of URL. 
getPath() Returns the path specified in a URL. 
getPort() Returns the port no. specified in URL. 
getQuery() Returns the query part in a URL. 
getScheme() Returns the scheme in a URL. 
isValid() Returns true if URL has a right syntax.
WMLScript Standard 
Libraries(Cont…) 
WMLBrowser – This library contains functions by which 
WMLScript can access the associated WML context. These 
functions must not have any side effects and must return 
invalid in cases where the system does not support 
WMLBrowser. 
Function Description 
getCurrentCard( 
Returns the (relative) URL of the current card. 
) 
getVar() Returns the value of a variable. 
go() Goes to the new card, specified by the new URL. 
newContext() Clears all variables, and returns an empty 
string. 
prev() Browser goes back to previous card. 
refresh() Refreshes the current card returns empty string.
WMLScript Standard 
Libraries(Cont…) 
Dialogs – This library contains a set of typical user 
interface functions including: 
Function Description 
alert() Displays a message, waits for a confirmation, and 
returns empty string. 
confirm() Displays a message, waits for an answer, and returns a 
boolean value depending on the selected answer. 
prompt() Displays a question, waits for an input, and then returns 
the user’s answer. 
The functions in Dialogs library are quite similar to 
JavaScript alerts and message boxes.
Example:Validating User 
Input 
We build a simple WML card that asks the user to input a 
social security number (an identification number). We will 
then use WMLScript to verify that the user’s input was 
formatted correctly. Following this verification, we’ll alert 
the user whether their number was accepted or not. 
First, let us create a normal WML file containing two 
cards(an input card and a results card). Accepting the input 
will result in our validateSSN() being called. 
Note that this function is stored in a separate .wmls file 
(WMLScriptExample.wmls) and is declared within that 
file using the extern keyword.
Example:Validating User 
Input(Cont…) 
WMLScriptExample.wml 
<wml> 
<card id="SSN" title="SSN:"> 
<do type="accept" label="Results"> 
<gohref = 
"WMLScriptExample.wmls#validateSSN($(SSN))“/> 
</do> 
<p> 
Enter SSN: <input type="text" name="SSN"/> </p> 
</card> 
<card id="Results" title="Results:">
Example:Validating User 
Input(Cont…) 
WMLScriptExample.wml 
<p> 
You entered: 
<br/> 
SSN: $(SSN) 
<br/> 
</p> 
</card> 
</wml>
Example:Validating User 
Input(Cont…) 
WMLScriptExample.wmls 
extern function validateSSN(SSN) 
{ 
if (String.length(SSN) != 9) 
{ 
WMLBrowser.setVar("SSN", "Error: String must be 9 digits 
long."); 
} 
WMLBrowser.go("WMLScriptExample.wml#Results"); 
};
Example:Validating User 
Input(Cont…)
Summary 
WMLScript is a client-side scripting language used 
to provide interactivity to thin clients via WML 
scripts. 
WMLScript is not embedded in WML pages unlike 
JavaScript. 
Contains six standard libraries to provide various 
functionalities. 
WMLScript is compiled into bytecode before it can 
be interpreted. 
WMLScript makes use of compilation units and 
pragmas.
Reference 
a. http://www.webreference.com/js/column61/4.html. 
b. http://www.w3schools.com/wmlscript. 
c. http://www.allnetdevices.com/developer/tutorials. 
d. http://updev.phone.com/dev/ts/htmldoc/41/wmldev. 
e. http://www.wirelessdevnet.com/channels/wap.
Thank You 
Any questions or suggestions ? 
shantikatta@usa.net

More Related Content

What's hot

MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
DarshanPatil82
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
Amith Tiwari
 
Transposition cipher techniques
Transposition cipher techniquesTransposition cipher techniques
Transposition cipher techniques
SHUBHA CHATURVEDI
 
Webservices
WebservicesWebservices
Webservices
Gerard Sylvester
 
Query trees
Query treesQuery trees
Query trees
Shefa Idrees
 
ENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGMohammad Adil
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
Rajapriya82
 
Task programming
Task programmingTask programming
Task programming
Yogendra Tamang
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
A. S. M. Shafi
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
Ramola Dhande
 
DTD
DTDDTD
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
vinitha96
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Dr. SELVAGANESAN S
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipher
Niloy Biswas
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
teach4uin
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
Bhargav Amin
 
Code generation
Code generationCode generation
Code generation
Aparna Nayak
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
ASHOK KUMAR REDDY
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
PoojaBele1
 

What's hot (20)

MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Transposition cipher techniques
Transposition cipher techniquesTransposition cipher techniques
Transposition cipher techniques
 
Webservices
WebservicesWebservices
Webservices
 
Query trees
Query treesQuery trees
Query trees
 
ENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELING
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
 
Task programming
Task programmingTask programming
Task programming
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
 
Sgml
SgmlSgml
Sgml
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
DTD
DTDDTD
DTD
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipher
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Code generation
Code generationCode generation
Code generation
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
 

Viewers also liked

ITFT_Wireless markup language
ITFT_Wireless markup languageITFT_Wireless markup language
ITFT_Wireless markup language
Shilpa Sharma
 
WML-Tutorial
WML-TutorialWML-Tutorial
WML-TutorialOPENLANE
 
Bt0087 wml and wap programing2
Bt0087 wml and wap programing2Bt0087 wml and wap programing2
Bt0087 wml and wap programing2
Techglyphs
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
Senthil Kanth
 
Introduction to Mobile Internet
Introduction to Mobile InternetIntroduction to Mobile Internet
Introduction to Mobile Internet
Shujaa Solutions Ltd
 
Wireless & Mobile Lecture # 18
Wireless & Mobile Lecture # 18Wireless & Mobile Lecture # 18
Wireless & Mobile Lecture # 18Bit Hacker
 
Wap wml
Wap wmlWap wml
Wap wml
ishmecse13
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentationRamyaRavi26
 
B spline surfeces
B spline surfecesB spline surfeces
B spline surfecesramac123
 
Bezier curve computer graphics
Bezier curve computer graphicsBezier curve computer graphics
Bezier curve computer graphics
University of Potsdam
 
Types of projections
Types of projectionsTypes of projections
Types of projections
Muhammad Umair Akram
 
Wireless application protocol wap
Wireless application protocol   wapWireless application protocol   wap
Wireless application protocol wap
Bharath Institude Of Science & Technology
 
Bezier curve computer graphics
Bezier curve computer graphics Bezier curve computer graphics
Bezier curve computer graphics
University of Potsdam
 
Bezier curves
Bezier curvesBezier curves
Bezier curves
Harmanpreet Singh
 
Color models
Color modelsColor models
Color models
Adri Jovin
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
Ankur Kumar
 
Color models
Color modelsColor models
Color models
Moahmed Sweelam
 
Presentation on bezier curve
Presentation on bezier curvePresentation on bezier curve
Presentation on bezier curve
Satyendra Rajput
 

Viewers also liked (20)

ITFT_Wireless markup language
ITFT_Wireless markup languageITFT_Wireless markup language
ITFT_Wireless markup language
 
WML-Tutorial
WML-TutorialWML-Tutorial
WML-Tutorial
 
Bt0087 wml and wap programing2
Bt0087 wml and wap programing2Bt0087 wml and wap programing2
Bt0087 wml and wap programing2
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
 
Introduction to Mobile Internet
Introduction to Mobile InternetIntroduction to Mobile Internet
Introduction to Mobile Internet
 
Wireless & Mobile Lecture # 18
Wireless & Mobile Lecture # 18Wireless & Mobile Lecture # 18
Wireless & Mobile Lecture # 18
 
Wap wml
Wap wmlWap wml
Wap wml
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
B spline surfeces
B spline surfecesB spline surfeces
B spline surfeces
 
Bezier curve computer graphics
Bezier curve computer graphicsBezier curve computer graphics
Bezier curve computer graphics
 
Types of projections
Types of projectionsTypes of projections
Types of projections
 
Face morphing
Face morphingFace morphing
Face morphing
 
B spline
B splineB spline
B spline
 
Wireless application protocol wap
Wireless application protocol   wapWireless application protocol   wap
Wireless application protocol wap
 
Bezier curve computer graphics
Bezier curve computer graphics Bezier curve computer graphics
Bezier curve computer graphics
 
Bezier curves
Bezier curvesBezier curves
Bezier curves
 
Color models
Color modelsColor models
Color models
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
 
Color models
Color modelsColor models
Color models
 
Presentation on bezier curve
Presentation on bezier curvePresentation on bezier curve
Presentation on bezier curve
 

Similar to WML Script by Shanti katta

Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+orderRamu Palanki
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
G.C Reddy
 
Web programming
Web programmingWeb programming
Web programming
Leo Mark Villar
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point developmentPranav Sharma
 
js.pptx
js.pptxjs.pptx
js.pptx
SuhaibKhan62
 
Java script
Java scriptJava script
Java script
Rajkiran Mummadi
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
Jalpesh Vasa
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
2javascript web programming with JAVA script
2javascript web programming with JAVA script2javascript web programming with JAVA script
2javascript web programming with JAVA script
umardanjumamaiwada
 
Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript Tutorial
DHTMLExtreme
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
ambuj pathak
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
nanjil1984
 
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and ScriptingIT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
pkaviya
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint development
Pranav Sharma
 

Similar to WML Script by Shanti katta (20)

Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
 
Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+order
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
 
Xml writers
Xml writersXml writers
Xml writers
 
Web programming
Web programmingWeb programming
Web programming
 
copa-ii.pptx
copa-ii.pptxcopa-ii.pptx
copa-ii.pptx
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point development
 
js.pptx
js.pptxjs.pptx
js.pptx
 
Advanced soa and web services
Advanced soa and web servicesAdvanced soa and web services
Advanced soa and web services
 
Java script
Java scriptJava script
Java script
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
chap04.ppt
chap04.pptchap04.ppt
chap04.ppt
 
2javascript web programming with JAVA script
2javascript web programming with JAVA script2javascript web programming with JAVA script
2javascript web programming with JAVA script
 
Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript Tutorial
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and ScriptingIT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint development
 

More from Senthil Kanth

Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2
Senthil Kanth
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1
Senthil Kanth
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application Protocol
Senthil Kanth
 
What is WAP?
What is WAP?What is WAP?
What is WAP?
Senthil Kanth
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
Senthil Kanth
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
Senthil Kanth
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
Senthil Kanth
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogi
Senthil Kanth
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by Alvinen
Senthil Kanth
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONS
Senthil Kanth
 
HR QUESTIONS
HR QUESTIONSHR QUESTIONS
HR QUESTIONS
Senthil Kanth
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBA
Senthil Kanth
 
RSA alogrithm
RSA alogrithmRSA alogrithm
RSA alogrithm
Senthil Kanth
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)
Senthil Kanth
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing Protocol
Senthil Kanth
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocols
Senthil Kanth
 
DSDV VS AODV
DSDV VS AODV DSDV VS AODV
DSDV VS AODV
Senthil Kanth
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System Structure
Senthil Kanth
 
15.Security
15.Security15.Security
15.Security
Senthil Kanth
 
14.Protection
14.Protection14.Protection
14.Protection
Senthil Kanth
 

More from Senthil Kanth (20)

Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application Protocol
 
What is WAP?
What is WAP?What is WAP?
What is WAP?
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogi
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by Alvinen
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONS
 
HR QUESTIONS
HR QUESTIONSHR QUESTIONS
HR QUESTIONS
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBA
 
RSA alogrithm
RSA alogrithmRSA alogrithm
RSA alogrithm
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing Protocol
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocols
 
DSDV VS AODV
DSDV VS AODV DSDV VS AODV
DSDV VS AODV
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System Structure
 
15.Security
15.Security15.Security
15.Security
 
14.Protection
14.Protection14.Protection
14.Protection
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 

Recently uploaded (20)

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 

WML Script by Shanti katta

  • 1. WML Script CS 486 Global Knowledge Networks Instructor: Dr.V.Juggy Presented By: Shanti Katta
  • 2. Objective What is WMLScript? What is WMLScript used for? WMLScript Vs JavaScript How to call WMLScript? Pragmas WMLScript language syntax Variables, naming rules, data types and operators WMLScript standard libraries Example Summary
  • 3. What is WMLScript? WMLScript is the client-side scripting language used in WML pages. WMLScript is a light version of JavaScript. WMLScripts are not embedded in the WML pages. WML pages only contain references to script URL’s. WMLScript is compiled into byte code on the server before it is sent to the WAP browser.
  • 4. What is WMLScript? (Cont…) WMLScript is part of the applications layer of the WAP architecture. WMLScript is an event-based language used to add interaction to documents. WMLScript has a weak type definition. They contain collection of related functions into source code files which are hosted on server and accessed through URL’s.
  • 5. What is WMLScript used for? WMLScript is used to validate user input. WMLScript is used to generate message boxes and dialog boxes locally, to view error messages and conformations faster. WMLScript is used to access facilities of the user agent. WMLScript enhances WML by adding local intelligence to distributed applications.
  • 6. What is WMLScript used for? (Cont…) WMLScript can be used to add procedural logic to WAP devices, either as part of WML documents, or as a standalone tool in independent applications. WMLScript can be used to add interaction and dynamic code to documents. WMLScript includes functions which are called if a task calling the functions has been linked to WML events and the event occurs.
  • 7. WMLScript Vs JavaScript WML contains references to the URL address of a WMLScript function, whereas JavaScript functions are normally embedded in HTML code. WMLScript units have to be compiled into binary WMLScript code before they can be executed in a WAP device. This means that WMLScript Virtual Machine (VM) has to be included on the browser that executes the script. WMLScript makes heavy use of libraries than JavaScript. Call-by-address is not supported by JavaScript. It supports only call-by-value.
  • 8. WMLScript Vs JavaScript (Cont…) Feature WMLScript JavaScript Supports objects No Yes Supports arrays No Yes Typeof returns Integer String Supports Libraries Yes No Supports extern Yes No Supports invalid Yes No Supports for..in No Yes Supports pragmas Yes No Supports delete No Yes
  • 9. WMLScript Vs JavaScript (Cont…) Feature WMLScript JavaScript Semicolons Mandatory Optional Supports HTML Comments No Yes Non-escape characters No Yes preceded by a backslash Names may include ‘$’ No Yes Supports global variables Yes Yes Supports auto declarations Yes Yes Supports the genericterm Yes No number Specifies max and min values Yes No
  • 10. How to call WMLScript? WMLScripts are not embedded in WML pages. The WML pages only contain references to script URL’s. In the example below, a card is created where you enter a URL, select the ‘go’ label, and then go off to the specified URL. <?xml version=“1.0”?> <!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” “http://www.wapforum.org/DTD/wml_1.1.xml”> <wml> <card id=“no1” title=“Go to URL”> <do type=“options” label=“Go”> <go href=“check.wmls#go_url(‘my_url’)”/> </do>
  • 11. How to call WMLScript? (Cont…) <p> Enter a URL: <input type=“text” name=“my_url”/> </p> </card> </wml/> The red line above contains a reference to a WMLScript. The script is in a file called check.wmls, and the name of the function is go_url. The go_url function sends you to the URL you entered. The function also checks if you omitted the “http://” part in the URL.
  • 12. How to call WMLScript? (Cont…) Here is the WML page called : check.wmls Extern function go_url (the_url) { if (String.find(the_url , “http://”) < 0 ) { the_url = “http://” + the_url; } WMLBrowser.go (the_url); } NOTE: The extern keyword is used to allow other functions access to this function, or WML events outside the .wmls file.
  • 13. WMLScript Bytecode Interpreter WMLScript must be compiled into binary form before it can be interpreted by the WMLScript bytecode interpreter. WMLScript compiler encodes one WMLScript compilation unit into WMLScript bytecode. Interpreter Architecture call http://www.host.com/script#myFunc(“Test”,12) WMLScript Libraries Functions Interpreter WMLScript Bytecode Functions ….. myFunc() State IP Operand Stack Call Stack Variables
  • 14. Pragmas… WMLScript is a compiled language and uses Compilation Units (Collection of functions) and Pragmas, which are contained in them. Pragmas are statements that are interpreted by the compiler. WMLScript uses pragmas to identify other compilation units that it uses. All pragmas are optional and appear at beginning of compilation unit, before any function declarations. There are 3 WMLScript pragmas :-
  • 15. Access Control Pragmas A WMLScript computation unit can protect its content by using a special access control pragma, which is examined before any externally-defined functions are executed. access Syntax: use access Domain domain_name Path path_name Domain domain_name path path_name One can restrict access to specific domains, specific paths, or their combinations. Path names can be absolute or relative, which are always converted to absolute later.
  • 16. Meta Pragmas Meta pragmas convey information to different entities in WAP environment. meta Syntax: Use meta Meta elementName “elementvalue” http equiv elementName “elementvalue” User agent elementName “elementvalue” Compilation units may contain more than 1 meta pragma, but no more than 1 meta pragma of same type.
  • 17. Meta Pragmas(Cont…) Name information is intended for origin servers, and may contain such information as copyright assignments. http equiv information is used to control HTTP headers. It is used to specify HTTP header information to mediating servers that transfer compilation unit. User agent information is reserved for passing information to specific WAP user agents to implement WAP extensions
  • 18. URL Pragmas To access a function outside of a compilation unit, one must include a pragma that associates the URL of the other compilation unit, an internal identifier, which can be used to access external functions. url Syntax: use url Identifier string_literal The use url pragma specifies the location (URL) of the external WMLScript resource and gives it a local name.
  • 19. URL Pragmas(Cont…) For example: use url DocJS “http://www.docjavascript.com/mywml”; function divide(nom, denom) { if (denominator = = 0) return invalid; return DocJS#mydiv(nom, denom); } The use url pragma specifies a URL to the compilation unit. Once the file is found, the function call DocJS#mydiv() triggers the loading of external compilation unit http://www.docjavascript.com/mywml.wmlsc.
  • 20. WMLScript Language Syntax WMLScript syntax is based on the ECMAScript. Following points summarize some basic syntactical features: The smallest unit of execution in WMLScript is a statement and each statement must end with a semicolon(;). WMLScript is case-sensitive. Comments can either be single-line(starting with //) or multiline (bracketed by /*…*/). A literal character string is defined as any sequence of zero or more characters enclosed within double(“ “) or single(‘ ‘).
  • 21. WMLScript Language Syntax(Cont…) New variables are declared using var keyword. Boolean literal values correspond to true and false. WMLScript is a weakly-typed language. Internally, the following data types are supported: Boolean, Integer, Floating-point, String, and Invalid. Includes assignment, arithmetic, logical, string, comparison, and array operations. Includes control statements like if-else, for loop, while loop, break and continue statements.
  • 22. Naming Rules Identifiers within WMLScript can be used to name variables, functions and pragmas. When managing names, WMLScript differentiates between three name spaces: function names function parameters and variables pragmas It is allowable to use the same name for a function and variable. Like most languages, WMLScript has a list of reserved words like access, agent, meta, url, use, etc.
  • 23. Variables and Data Types WMLScript is a weakly typed language. No type checking is done at compile-time and no variable types are declared. Four types of values can be declared for WMLScript variables: integer, floating point, string and Boolean. The fifth type is invalid, which is reserved for cases when the type cannot be determined. This may happen in type conversions or when dividing by zero. Because the data types are only supported internally, they are not defined during the declarations, but the type is determined during the execution of the function. WMLScript converts between the types if necessary.
  • 24. Operators WMLScript supports 45 arithmetic, assignment, and logical operators. Arithmetic: Provides basic math in WMLScript, including addition, subtraction, multiplication, floating point and integer division. Assignment: Allows assignment of a value to a variable, but WMLScript also supports assignment with operators. Logical: WMLScript supports logical operations AND, OR and NOT. If WMLScript evaluates the first operand to be INVALID, the expression is INVALID.
  • 25. WMLScript Standard Libraries While WMLScript does not support the creation of new objects via object-oriented programming, it does provide six “pre-built” libraries. Lang – This library contains a set of functions that are closely related to the WMLScript language core. Included in this library are functions for data type manipulation, absolute value calculations, and random number generation. Function Description abort() Aborts a WMLScript and returns a message to the caller Abs() Returns the absolute value of a number. characterSet() Returns the character set supported by WMLScript interpreter.
  • 26. WMLScript Standard Libraries(Cont…) exit() Exits a WMLScript and returns a message to the caller. float() Returns true if floating-point numbers are supported. isFloat() Returns true if specified value can be converted into float. max() Returns the largest value of two numbers. maxInt() Returns the maximum possible integer value. random() Returns random integer between 0 and specified number. seed() Initializes random number generator with a number. Note: Since the Lang library contains some functions that we would expect to find in a Math library, the Lang library has a little misleading name. But it is called the Lang Library because it contains functions that are closely related to the core of WMLScript engine.
  • 27. WMLScript Standard Libraries(Cont…) Float – The Float library is optional and is only supported on those clients who have floating-point capabilities. Typical functions provided are: Function Description ceil() Returns the nearest integer not smaller than given no. floor() Returns the nearest integer not longer than given no. int() Returns the integer part of a specified number maxFloat() Returns the largest possible floating-point number. minFloat() Returns the smallest possible floating-point number. pow() Raises a no. to the power of a second number. round() Returns the nearest integer to a specified number. sqrt() Returns the square root of a specified number.
  • 28. WMLScript Standard Libraries(Cont…) String – The String library contains a set of functions for performing string operations. Function Description charAt() Returns a character is placed in a specified position. compare() Compare two strings, and returns an integer. elementAt() Separates a string into elements and returns element. elements() Returns the frequency of a specified value in a string. squeeze() Reduces all white spaces to single spaces. find() Returns the position of a substring in a string. format() Formats a value, and returns result. trim() Returns a string without leading and trailing spaces. toString() Creates a string from a number, and returns the result.
  • 29. WMLScript Standard Libraries(Cont…) URL – This library contains a set of functions for handling both absolute URLs and relative URLs. Typical functions: Function Description escapeString() Replaces special char’s in URL with escape sequence. getFragment() Returns the fragment in a URL. getHost() Returns the host specified in a URL. getParameters() Returns parameters in last path segment of URL. getPath() Returns the path specified in a URL. getPort() Returns the port no. specified in URL. getQuery() Returns the query part in a URL. getScheme() Returns the scheme in a URL. isValid() Returns true if URL has a right syntax.
  • 30. WMLScript Standard Libraries(Cont…) WMLBrowser – This library contains functions by which WMLScript can access the associated WML context. These functions must not have any side effects and must return invalid in cases where the system does not support WMLBrowser. Function Description getCurrentCard( Returns the (relative) URL of the current card. ) getVar() Returns the value of a variable. go() Goes to the new card, specified by the new URL. newContext() Clears all variables, and returns an empty string. prev() Browser goes back to previous card. refresh() Refreshes the current card returns empty string.
  • 31. WMLScript Standard Libraries(Cont…) Dialogs – This library contains a set of typical user interface functions including: Function Description alert() Displays a message, waits for a confirmation, and returns empty string. confirm() Displays a message, waits for an answer, and returns a boolean value depending on the selected answer. prompt() Displays a question, waits for an input, and then returns the user’s answer. The functions in Dialogs library are quite similar to JavaScript alerts and message boxes.
  • 32. Example:Validating User Input We build a simple WML card that asks the user to input a social security number (an identification number). We will then use WMLScript to verify that the user’s input was formatted correctly. Following this verification, we’ll alert the user whether their number was accepted or not. First, let us create a normal WML file containing two cards(an input card and a results card). Accepting the input will result in our validateSSN() being called. Note that this function is stored in a separate .wmls file (WMLScriptExample.wmls) and is declared within that file using the extern keyword.
  • 33. Example:Validating User Input(Cont…) WMLScriptExample.wml <wml> <card id="SSN" title="SSN:"> <do type="accept" label="Results"> <gohref = "WMLScriptExample.wmls#validateSSN($(SSN))“/> </do> <p> Enter SSN: <input type="text" name="SSN"/> </p> </card> <card id="Results" title="Results:">
  • 34. Example:Validating User Input(Cont…) WMLScriptExample.wml <p> You entered: <br/> SSN: $(SSN) <br/> </p> </card> </wml>
  • 35. Example:Validating User Input(Cont…) WMLScriptExample.wmls extern function validateSSN(SSN) { if (String.length(SSN) != 9) { WMLBrowser.setVar("SSN", "Error: String must be 9 digits long."); } WMLBrowser.go("WMLScriptExample.wml#Results"); };
  • 37. Summary WMLScript is a client-side scripting language used to provide interactivity to thin clients via WML scripts. WMLScript is not embedded in WML pages unlike JavaScript. Contains six standard libraries to provide various functionalities. WMLScript is compiled into bytecode before it can be interpreted. WMLScript makes use of compilation units and pragmas.
  • 38. Reference a. http://www.webreference.com/js/column61/4.html. b. http://www.w3schools.com/wmlscript. c. http://www.allnetdevices.com/developer/tutorials. d. http://updev.phone.com/dev/ts/htmldoc/41/wmldev. e. http://www.wirelessdevnet.com/channels/wap.
  • 39. Thank You Any questions or suggestions ? shantikatta@usa.net

Editor's Notes

  1. WMLScript is a client side scripting language based on ECMAScript (which is based on Netscape’s JavaScript language), whose purpose is to provide client-side procedural logic. It provides general scripting capabilities to the Wireless Application Protocol(WAP) architecture. Specifically, WMLScript complements the Wireless Markup Language (WML). While WML focuses on content. It is a declarative document markup language designed to convey the essence of a user-interface. WMLScript is imperative language which focuses on procedure and logic.
  2. WMLScript belongs to the application layer of the WAP archicture and makes use of services and facilities of the lower layers. It causes WML documents to interact with the users.WMLScript is to WML, is like JavaScript is to HTML. WMLScript is the JavaScript of the wireless world. WMLScript has a weak type definition which means that variable types are not defined during declaration, the data types are determined during execution. While the WMLScript code is maintained on the servers, the script execution takes place on the local device.
  3. WML, which is based on Extensible Markup Language(XML), specifies application content for narrowband devices like cell phones. WML allows simple formatting to make the user interface more readable, but its content is static with the following limitations: 1)checking the validity of user input. 2)Access to facilities of the device. For example, on a phone, allow the programmer to make phone calls, send messages etc. 3)Generating messages and dialogs locally thereby reducing the need for expensive round-trips to show alerts, error messages, confirmations, etc. 4)Allowing extensions to the device software and configuration of the device after it has been deployed. WMLScript is designed to overcome these limitations and to provide programmable functionality that can be used over narrowband communication links in clients with limited capabilities. WmlScript is a function-oriented scripting language which enhances WML applications.
  4. WMLScript focuses on procedure and logic. It adds dynamic code to static WML data. For example, when validating form field entries, providing rapid responses and calculations, for expanding the normal functions to mobile phones, sending messages and dialogs and even for creating games. Many of the services that can be used with thin mobile clients can be implemented with WML.. Scripting enhances the standard browsing and presentation facilities of WML with behavioral capabilities. They can be used to support more advanced User Interface(UI) functions, add intelligence to the client, provide access to the device and its peripheral functionality, and reduce the amount of bandwidth needed to send data between the server and the client.
  5. WMLScript is simple scripting language similar to JavaScript but there are, quite a lot of differences between the two. While HTML documents normally contain embedded JavaScript code, WML only contains references to the URL addresses of a WMLScript function. Unlike HTML, in which the JavaScript code is compiled along with HTML, WMLScript has to be compiled into binary code before being executed on a WAP device. Therefore a WMLScript Virtual Machine has to be included in the browser that executes the script. To speed up data transfer, WMLScript libraries are pre-compiled and loaded to the user agent’s memory, providing quick access to the WMLScript script. JavaScript does not support call-by-address whereas it is supported in WMLScript. That is, an argument can be set inside a function and communicated back to the caller. JavaScript, on the otherhand supports call-by-value, that is, functions can read parameter values from their caller, but cannot change these values in the caller’s scope.
  6. WMLScript code is written in normal text files with the extension *.wmls (for example, script1.wmls). These text files are placed on the same server as normal WML documents; however, it is also possible to call WMLScript functions on other servers from within WML documents or from WMLScript code. A text file is called a compilation unit, and it may contain one or several functions. A compilation unit can be placed in the same directory as WML documents, or in a separate subdirectory. Functions that have similar properties should be placed in the same compilation unit. When a WML document contains a reference to a WMLScript function, the call will be routed from the browser through the gateway to the server. The server will then send the necessary WMLScript compilation, which is converted into binary format in the gateway.
  7. The reason for this is, that binary file is smaller and therefore easier to transmit over a wireless network. The binary file is sent from the gateway to the WAP browser. The WAP browser has an interpreter that is able to execute WMLScript programs in their binary format. The same reference system is used for calling WMLScript functions as in HTML and WWW, which means that resources are referred to with their relative or absolute addresses. The call should always include the name of the target WMLScript function and its list of parameters. The call may be absolute or relative.
  8. The WMLScript function may call functions within the same compilation unit or functions in other compilation units or libraries. If the WMLScript function is defined with the word extern, it can be called from any other compilation unit, unless it is protected by access control programs.
  9. WMLScript is a compiled language and uses Compilation Units and Pragmas. In addition to collection of functions, a compilation unit also contains Pragmas, which are the statements interpreted by the compiler. A pragma is a directive that generates special behavior from the compiler. All pragmas are optional, but if used must be preceded by the keyword use and appear at the beginning of a compilation unit before any function declarations. A certain application may include separate scripts that were individually and independently compiled. A compilation unit can call functions that are defined in another compilation unit. WMLScript uses pragmas to identify other compilation units that it uses.
  10. A WMLScript computation unit can protect its content by using a special access control pragma, which is examined before any externally-defined functions are executed. A compilation unit may use only one access control pragma. The use access pragma is written at the beginning of the WMLScript compilation unit. For example, use access domain “wap.acta.fi” path “/wap”; An access control pragma is specified by the unique word access. The level of protection is always checked before the function is executed. If the compilation unit contains the defined reserved words use access in front of the domain name(with the reserved word domain) and/or a path(with reserved word path), the authority of the compilation unit that calls the pragma-protected function to execute the function will be checked before execution. The syntax of access control pragma may be specified in any one of the ways: use access domain use access domain ; use access path ; Use access domain path ;
  11. The third type of pragma is the meta pragma. It communicates between different players of the wireless communication: originating connection servers and user agents. The name meta pragma request the originating servers for different kinds of information. Meta pragmas convey information to different entities in the WAP environment. Compilation units may contain more than one meta pragma, but no more than one meta pragma of the same type.
  12. The Name information is intended for origin servers, and may contain such information as copyright assignments. Network servers should not emit WMLScripts containing, and user agents should ignore, meta pragmas. For Example, use meta name “Created” “22-May-00”; http equiv information is used to control HTTP headers. It is used to specify HTTP header information between intermediating servers that transfer the compilation unit. For Example: use meta http equiv “keywords” “Script, Language”; User agent information is reserved for passing information to specific WAP user agents to implement WAP extensions. For Example: use meta user agent “Type” “Test”;
  13. Functions in WMLScript are accessed by using a URL. To access a function outside of a compilation unit, one must include a pragma that associates the URL of the other compilation unit an internal identifier. The identifier can then be used to access the external function. Multiple url pragmas are permitted in a compilation unit. The use url pragma specifies the location (URL) of the external WMLScript resource and gives it a local name. This name can then be used inside a function declarations to make external function calls.
  14. For example: use url DocJS “http://www.docjavascript.com/mywml”; function divide(nom, denom) { if (denominator == 0) return invalid; return DocJS#mydiv(nom, denom); } The use url pragma specifies a URL to a WMLScript compilation unit, http://www.docjavascript.com/mywml. If the file extension is omitted, the user agent will look for the extension .wmlsc , I.e it will look for http://www.docjavascript.com/mywml.wmlsc . Once the file is found, the function call DocJS#mydiv() triggers the loading of the external compilation unit, http://www.docjavascript.com/mywml.wmlsc. Upon successful loading of the external resource, its content is verified to have the definition of the mydiv() function, and it is with the calling parameters, mydiv(nom, denom).