WML <go> Tag

Advertisements


The <go/> element represents a <go> task represents the action of going to a new card.

Attributes:

This element supports the following attributes:

AttributeValueDescription
hrefURLGives the URL of the new card. Relative URLs are resolved relative to the current card
method
  • get

  • post

Specifies the method that should be used to fetch the deck. This must be one of the values get or post, corresponding to the GET and POST methods of HTTP.

When using method="get", the data is sent as an request with ? data appended to the url. The method has a disadvantage, that it can be used only for a limited amount of data, and if you send sensitive information it will be displayed on the screen and saved in the web server's logs. So do not use this method if you are sending password etc.

With method="post", the data is sent as an request with the data sent in the body of the request. This method has no limit, and sensitive information is not visible in the URL

sendreferer
  • true

  • false

If set to true, the browser sends the URL of the current deck along with the request. This URL is sent as a relative URL if possible. The purpose of this is to allow servers to perform simple access control on decks, based on which decks are linking to them. For example, using HTTP, this attribute is sent in the HTTP Referer header.
accept-charsetcharset_listSpecifies a comma- or space-separated list of character sets that can encode data sent to the server in a POST request. The default value is "unknown".
classclass dataSets a class name for the element.
idelement IDA unique ID for the element.

Example:

Following is the example showing usage of <go> element.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="GO Element">
<p>
   <anchor>
       Chapter 2 : <go href="chapter2.wml"/>
   </anchor>
</p>
</card>
</wml>

Another example showing how to upload data using Get Method

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="GO Element">
<p>
   <anchor>
      Using Get Method 
      <go href="chapter2.wml?x=17&y=42" method="get"/>
   </anchor>
</p>
</card>

</wml>

Another example showing how to upload data using <setvar> element.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="GO Element">
<p>
   <anchor>

      Using setvar:
	  <go href="chapter2.wml"> 
	      <setvar name="x" value="17"/> 
  	      <setvar name="y" value="42"/> 
	  </go>
   </anchor>
</p>
</card>

</wml>

Another example showing how to upload data using <postfiled> element

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="GO Element">
<p>
   <anchor>
      Using setvar:
	  <go href="chapter2.wml" method="get"> 
              <postfield name="x" value="17"/>
              <postfield name="y" value="42"/>

	  </go>
   </anchor>
</p>
</card>

</wml>


Advertisements
Advertisements