WML Learning (iv): Anchors and tasks

Source: Internet
Author: User
Tags add character set header html form html page prev tag name variable

Anchors and Tasks
The connection is the most basic function of the HTML page, and in WML it is also used <a href= "url" title= "label" > and </a> to include the text used to establish the connection, and the required attribute href specifies the URL to open. The optional Title property gives the connection a tag name that will appear as a accept key for one of the soft buttons (see the previous HDML entry) in the Soft button area of the screen, so you can usually use the attribute as the prompt text.

However, the above connection is only a task in WML, in order to be able to use other tasks, so introduced a new tag <anchor title= "label" > Task label text </anchor>,<a> is actually when the task label is A simple representation of <go/>.

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

<wml>
<card>
<p>
<anchor title= "Link1" ><go href= "TEST1.WML"/>news</anchor><br/>
<a title= "Link2" href= "TEST2.WML" >Sports</a>
</p>
</card>
</wml>

The task tags in WML are as follows: In addition to &LT;ANCHOR&GT, they can also be used in events.

1) <go> instructs the browser to display the specified URL, including deck's first card or the specified card. The syntax is as follows:
<go href= "url" sendreferer= "false|true" method= "Get|post" accept-charset= "CharSet" >
<postfield name= "name" value= "value"/>
<setvar name= "name" value= "value"/>
</go>

Where the href attribute is required and the other is optional. The Sendreferer property indicates whether the URL of the page that invokes the URL specified by href is passed, which is the URL of the current page, the Http_referer in the HTTP header, the default value is False, and the optional value is true. Method is the same as the methods property of form form in HTML, specifying whether the form is submitted in Get or post for CGI processing, the default value is get, but if method is not specified but there is a <go></go> between <postfield&gt, the mobile phone is automatically delivered by post. The Accept-charset property can override the character set specified in the HTTP header, and can write multiple character sets, such as accept-charset= "Utf-8,us-ascii, iso-8859-1".

The <postfield name= "name" value= "value"/> can be viewed as <input type= "HIDDEN" name= "variable name" value= "value" in an HTML form form. It can pass data in the form of "variable name/value" to the specified URL. Both the name and value properties are required. Note that only the variables here are used to submit to the CGI program.

In addition to &LT;POSTFIELD&GT, you can add one or more sentences <setvar name= "name" value= "value"/&gt between <go> and </go>, which means that Assigns a value to a variable when an event is triggered.

Note that when there is no statement between <go> and </go>, it is more special to use the form of <go/>, such as <anchor title= "Link1" ><go href= " TEST.WML "/>news</anchor>.

2) <prev> is used to push the URL of the current page into the URL history stack and open the previous URL, if the URL does not exist, then <prev> invalid. Syntax is similar to <go>:<prev><setvar name= "name" value= "value"/></prev>,<prev> and </prev> Can add one or more sentences <setvar name= "name" value= "value"/&gt, if not added, it must become a form of <prev/>.

3 <refresh> used to refresh the current page, so that the variable in the page refresh, syntax <refresh><setvar name= "name" value= "value"/></refresh >.

4) <noop&gt, means nothing, the label can not be used in <anchor>, generally used in the coverage deck level <do> (will be explained later)



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.