Anchors and tasks
Connection is the most basic function in HTML pages. In WML, <a href="url" title="label"> and</a> are also used in WML to include the text used to establish the connection. The required attribute href specifies the URL to be opened. The optional title attribute gives the connection a tag name. This name will be displayed as one of the ACCEPT keys (see the previous HDML introduction article for details) in the soft button area of the screen, so the attribute can usually be used as prompt text.
However, the above connection is only a case of tasks in WML. In order to be able to use other tasks, a new tag <anchor title="label">task tag text</anchor> was introduced, which is actually a simple representation when the task tag is <go/>.
---------------
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1.">
<wml>
<card>
<p>
<anchor title="Link1"><go href=""/>News</anchor><br/>
<a title="Link2" href="">Sports</a>
</p>
</card>
</wml>
There are the following types of task tags in WML, which can be used in events in addition to being used in <anchor>:
1) <go> is used to instruct the browser to display the specified URL, including the first CARD of the DECK 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>
Among them, the href attribute is required and the others are optional. The sendreferer attribute indicates whether to pass the URL of the page that calls the URL specified by href, that is, the URL of the current page, that is, HTTP_REFERER in the HTTP header, the default value is false, and the optional value is true. The method is the same as the method attribute of the form FORM in HTML. It specifies whether the form is submitted in the form get or post for processing, so that CGI can handle it. The default value is get, but if the method is not specified but <go></go> exists <postfield>, the mobile phone will automatically pass it in the post. The accept-charset attribute can override the character set specified in the HTTP header, and multiple character sets can be written, such as accept-charset="UTF-8,US-ASCII, ISO-8859-1".
<postfield name="name" value="value"/> can be regarded as <INPUT TYPE="HIDDEN" NAME="Variable Name" VALUE="value"> in the HTML form FORM, through which data in the form of "variable name/value" can be passed to the specified URL. Both name and value attributes are required. Note that only the variables here are used to submit to the CGI program.
In addition to <postfield>, you can also add one or more sentences between <go> and</go>. The meaning of this statement is to assign a value to the variable when an event is triggered.
It should be noted that when there is no statement between <go> and </go>, the form of <go> should be used, which is more special, such as <anchor title="Link1"><go href=""/>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, <prev> is invalid. The grammar is similar to <go>: <prev><setvar name="name" value="value"/></prev>. One or more sentences can be added between <prev> and </prev>. If not added, it must be in the form of <prev/>.
3)<refresh> is used to refresh the current page, so that the variables in the page are refreshed, and the syntax is <refresh><setvar name="name" value="value"/></refresh>.
4) <noop> means that nothing is done. This tag cannot be used in <anchor>, and is generally used to cover the DECK level <do> (it will be explained later)
Connection is the most basic function in HTML pages. In WML, <a href="url" title="label"> and</a> are also used in WML to include the text used to establish the connection. The required attribute href specifies the URL to be opened. The optional title attribute gives the connection a tag name. This name will be displayed as one of the ACCEPT keys (see the previous HDML introduction article for details) in the soft button area of the screen, so the attribute can usually be used as prompt text.
However, the above connection is only a case of tasks in WML. In order to be able to use other tasks, a new tag <anchor title="label">task tag text</anchor> was introduced, which is actually a simple representation when the task tag is <go/>.
---------------
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1.">
<wml>
<card>
<p>
<anchor title="Link1"><go href=""/>News</anchor><br/>
<a title="Link2" href="">Sports</a>
</p>
</card>
</wml>
There are the following types of task tags in WML, which can be used in events in addition to being used in <anchor>:
1) <go> is used to instruct the browser to display the specified URL, including the first CARD of the DECK 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>
Among them, the href attribute is required and the others are optional. The sendreferer attribute indicates whether to pass the URL of the page that calls the URL specified by href, that is, the URL of the current page, that is, HTTP_REFERER in the HTTP header, the default value is false, and the optional value is true. The method is the same as the method attribute of the form FORM in HTML. It specifies whether the form is submitted in the form get or post for processing, so that CGI can handle it. The default value is get, but if the method is not specified but <go></go> exists <postfield>, the mobile phone will automatically pass it in the post. The accept-charset attribute can override the character set specified in the HTTP header, and multiple character sets can be written, such as accept-charset="UTF-8,US-ASCII, ISO-8859-1".
<postfield name="name" value="value"/> can be regarded as <INPUT TYPE="HIDDEN" NAME="Variable Name" VALUE="value"> in the HTML form FORM, through which data in the form of "variable name/value" can be passed to the specified URL. Both name and value attributes are required. Note that only the variables here are used to submit to the CGI program.
In addition to <postfield>, you can also add one or more sentences between <go> and</go>. The meaning of this statement is to assign a value to the variable when an event is triggered.
It should be noted that when there is no statement between <go> and </go>, the form of <go> should be used, which is more special, such as <anchor title="Link1"><go href=""/>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, <prev> is invalid. The grammar is similar to <go>: <prev><setvar name="name" value="value"/></prev>. One or more sentences can be added between <prev> and </prev>. If not added, it must be in the form of <prev/>.
3)<refresh> is used to refresh the current page, so that the variables in the page are refreshed, and the syntax is <refresh><setvar name="name" value="value"/></refresh>.
4) <noop> means that nothing is done. This tag cannot be used in <anchor>, and is generally used to cover the DECK level <do> (it will be explained later)