R4R
Right Place For Right Person TM
 

R4R WMLScript


R4R
provide basic WMLScript Tutorials concept with WMLScript Examples . Through R4R you can develop WMLScript programming concept. R4R provide WMLScript Interview Questions with answers.R4R provide WMLScript Languages study materials in easy way.

Introduction of WMLScript:

The WMLScript language is part of the industry-wide standard for wireless applications called Wireless Application Protocol (WAP) .WMLScript (Wireless Markup Language Script) is the client-side scripting language of WML (Wireless Markup Language). WMLScript is work with WML pages. And WML pages can displayed on WAP browser. Using WMLScript we can validate user input, generate dialog boxes, view error messages, access facilities of the user agent etc.A scripting language is similar to a programming language, but it is light weight. With WMLScript , the wireless device can do some of the processing and computation. This reduces the number of requests and responses to/from the server. In the old days, fewer round-trips can improve the performance of your WAP site significantly since data transmission over wireless networks is slow. Today, the performance gained may not be so significant any more as data transmission speed has improved a lot. However, you may still find WMLScript useful since putting some operations at the client-side can reduce the load of your servers.
WMLScript is based on ECMAScript (European Computer Manufacturers Association Script), which is JavaScript's standardized version. So, the syntax of WMLScript is very similar to JavaScript. (In case you do not know, JavaScript is a scripting language commonly used on the web.) If you have some programming experience with JavaScript, you should be able to learn WMLScript quickly.

Diffrence between Javascript and WMLScript:

A most important  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 separated from the WML markup. URLs are used to refer to the actual WMLScript code in the WML document.

Some Other Diffrence:

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

typeof returns

an integer

a string

Supports arrays

No

Yes

Supports objects

No

Yes

 

 

 

WML Scripts Standard Libraries:

WMLScript has a core group of six standard libraries. Each of the various libraries contains from three to seventeen functions that perform useful tasks related in concept to the library name.

The six standard libraries are:
Lang Library
Float Library
String Library
URL Library
WMLBrowser Library
Dialogs Libraryjd


1.Lang: The Lang library provides functions related to the WMLScript language core.
Example Function: abs(),abort(), characterSet(),float(), isFloat(), isInt(), max(), isMax(), min(), minInt(), maxInt(), parseFloat(), parseInt(), random(), seed()

2.Float: The Float library contains functions that help us perform floating-point arithmetic operations.
Example Function: sqrt(), round(), pow(), ceil(), floor(), int(), maxFloat(), minFloat()

3.String: The String library provides a number of functions that help us manipulate strings.
Example Function: length(), charAt(), find(), replace(), trim(), compare(), format(), isEmpty(), squeeze(), toString(), elementAt(), elements(), insertAt(), removeAt(), replaceAt()

4.URL: The URL library contains functions that help us manipulate URLs.
Example Function: getPath(), getReferer(), getHost(), getBase(), escapeString(), isValid(), loadString(), resolve(), unescapeString(), getFragment()

5.WMLBrowser: The WMLBrowser library provides a group of functions to control the WML browser or to get information from it.
Example Function: go(), prev(), next(), getCurrentCard(), refresh(), getVar(), setVar()

6.Dialogs: The Dialogs library Contains the user interface functions.
Example Function: prompt(), confirm(), alert()

Advantage of WMLScript:

(1) To check the legitimacy of user input:
(2)To expand the functions of the user's browser, for example, allows programmers to develop mobile phone calls, send text messages, store phone numbers, phone book or SIM card management, etc.
(3) To generate the client confirmed that prompts a warning message or dialog box operation, and quickly displayed in the browser.
(4) Change the user's browser, the browser client to the software and the expansion and configuration parameters.

Working Of WMLScript with Example:

WMLScript functions or statements are not defined inside a WML page. Instead, all WMLScript language or statements are stored in another file with file extension .wmls (Wireless Markup Language Script).When your WML page calls a WMLScript function, you call the reference of the function by URL. When a function of WMLScript is called, the script is compiled into byte code by the WAP gateway and then sent to the micro-browser for interpretation.

Simple Example:


 <?xml version="1.0"?>
 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml_1.3.xml">
 <wml>
 <card id="Line" title="First WMLScript">
  <onevent type="onenterforward">
    <go href="ashish.wmls#hello()" />
 </onevent>
      <p> $message </p>
 </card>
11: </wml>


This is a WML page (not WMLScript) containing only one card. Inside this card, an event with type onenterforward (lines 6) is defined so that when the card is loaded, the following action is activated.


<go href="ex21-16.wmls#hello()" />

Example: ashish.wmls - WMLScript File For ashish.wml


1: extern function hello()
2: {
3:   WMLBrowser.setVar( "message",
4:      "Hello World! \n I know WMLScript now." );
5:   WMLBrowser.refresh();
6: }

This WMLScript contains one function called hello(). The function is declared as extern (external) so that it can be called by other cards and applications.

WMLBrowser.refresh();


This refresh() function from the WMLBrowser object is to refresh the WML page ashish.wml so that the message is displayed. A screen shot is shown in Fig.


Tolal:0 Click:
Show All Comments

Post Your Comments

Your Name:

Your Email ID :
Comments :
URL
  =* Enter SUM

New Updates

10:New Updates
Tutorials,examples and Interview Questions with answers
Posted By: Shashi     Posted Date:02.10.14

9:C# Tutorials,C# examples and C# Interview Questions with answers
R4R provide C# Tutorials,C# examples and C# Interview Questions with answers. Through R4R you can develop a small application and small programs.We cover C# Tutorials,C# examples and C# Interview Questions and answers for freshers as well experienced programmer.
Posted By: Shashi     Posted Date:11.17.13

8:Java/J2EE(Servlet,JSP,JNDI,Struts,Spring,Hibernate,EJB,JSF,JMS,Web-Services)
In this section R4R covers Java/J2EE(Servlet,JSP, JNDI, Struts, Spring, Hibernate, EJB,JSF,JMS,Web-Services) Tutorials with Examples.R4R provide Java/J2EE (Servlet,JSP, JNDI,Struts, Spring, Hibernate, EJB, JSF, JMS, Web-Services) Interview Questions with answers study materials for freshers and experienced.
Posted By: Shashi     Posted Date:11.13.13

7:CoreJava Tutorials , CoreJava Examples and CoreJava Interview Questions with answers
In this section R4R covers CoreJava Tutorials with CoreJava Examples. R4R covers CoreJava programming concept in easy way. R4R provide CoreJava Interview Questions with answers study materials for freshers and experienced.
Posted By: Shashi     Posted Date:11.04.13

6:Microsoft.net Technology ASP.NET,c# ,ADO.NET,WCF,WPF,Silverlight ,VB.net
R4R provides Microsoft Technologies(like ASP.NET,c# ,ADO.NET,WCF,WPF, Silverlight and VB.ne)Tutorials with Examples,programming concept and Interview Questions with answers study materials for freshers and experienced.
Posted By: Shashi     Posted Date:11.04.13

5:J2me Tutorials concept with Examples with Netbean IDE and J2ME Application Examples.
R4R cover basic J2me Tutorials concept with Examples and provide a way to develop J2me programming concept in easy way. R4R provide J2me Interview Questions with answers.R4R provide J2me Languages study materials with examples uing Netbean IDE and J2ME Application Examples.
Posted By: Shashi     Posted Date:10.30.13

4:J2me Tutorials concept with Examples ith netbean IDE and J2ME Application Examples.
R4R cover basic J2me Tutorials concept with Examples and provide a way to develop J2me programming concept in easy way. R4R provide J2me Interview Questions with answers.R4R provide J2me Languages study materials with examples uing Netbean IDE and J2ME Application Examples.
Posted By: Shashi     Posted Date:10.30.13

3:Java ebooks , Java tutorials , Java examples , Java interview questions and answers
R4R provides study materials for Java/j2EE technologies. R4R covers core java, advanced java, servlet, JSP, Struts, Spring, Hibernate, EJB, JSF, J2ME, ANT, JUnit and Some APIS .R4R also provides ebooks,tutorials,examples, interview questions and answers.
Posted By: Shashi     Posted Date:10.30.13

2:Learn basic C++ Tutorials with Examples , C++ Interview Questions with answers
R4R is a free E-learning website.You can learn basic C++ Tutorials with Examples , C++ Interview Questions with answers and also some hot topics.
Posted By: Shashi     Posted Date:10.30.13

1:C Tutorials with Example C subjective and objective interview questions and answers
R4R provide C Tutorials with Example and also provides C subjective and objective interview questions and answers.You can learn C in easy way.We cover basics of C here and give some examples.
Posted By: Shashi     Posted Date:10.30.13

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R