WML Tutorial 3: Tasks and navigation-assignment and data exchange

Source: Internet
Author: User
Tags count variable
Navigation | tutorials | data

Tasks and navigation-assignment and data exchange
This section briefly explains the variable assignment and data submission methods for WML, which are explained in a later section.

Variable Assignment (Setvar)
Setvar assigns a value to the browser's current page variable, which can be invoked in any card in the current dock.

Related properties:

1. Name variable name, as the identity of the access variable

Example: <setvar name= $bogus value= $bear >

2. Values of value variables

Data Interchange (Postfield)
Postfield uses a URL to exchange data with a CGI.

Related properties:

The name and value of the variable used for the name & Value Exchange parameter.

Example: <postfield name= $bogus value= $bear >

An example of a comprehensive application

Example:

<?xml version= "1.0"?>
<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "http://www.wapforum.com/DTD/wml_1.1.xml" >
<wml>

<card id= "Start" title= "Sina WAP" >
<do type= "Accept" >
<setvar name= "mycgi" value= "/cgi-bin/count.pl" >
<go href= "$MyCGI" method= "POST" >
<postfield name= "One" value= "one One"/>
<postfield name= "Two" value= "two two"/>
</go>
</do>
<p>hello world!</p>
</card>
</wml>

The previous example is equivalent to generating a POST request for a count.pl?one= "one" &two= "two two".



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.