WML Primary tutorial on the structure of WML documents

Source: Internet
Author: User
Tags header version domain access to domain
Tutorials | detailed

1. Statement (Prologue)

>


2, elements (Element)

WML first defines a deck, and then encapsulates the information and card within the deck.

3. File header (head element)

Header information contains information about deck, including meta data and control elements.

3.1, Access rights settings (Access)

This element is used to set a list that has access to the current deck permission. If the access element information is not included in the deck, the access element under the deck is in an invalid state, and all other deck can access the deck.

Related properties:

Domain: If you set then http://www.sina.com.cn/will have access, and http://www.sino.com.cn/and http:// Www.sina.net.cn/is not.

Path: Works very similar to domain, such as setting then "/INTERNAL/WML" will gain access, and "/INTERNAL-WML" is not.

Example:

Make the following settings

Then several URLs have access rights:

http://www.sina.com.cn/wap/goto.cgi
Http://www.sina.com.cn/wap/index.wml
http://www.sina.com.cn/wap/cgi-bin/create_report.cgi?name=123&pwd=234

Some of the following URLs do not have access rights:

http://www.sina.com/wap/getuid.cgi
http://www.sina.com.cn/internal/wap/getuid.cgi

3.2. Header element settings (META)

The and similar in HTML, provides meta information for the deck.

For example:

The content attribute is required and depends on the property. The scheme attribute is not currently supported. Forua is an optional attribute that specifies whether the label is removed by the intermediary agent (because the protocol for the transfer may change) before the WML file is uploaded to the client, and the default value is False.

Currently supported Meta data:

specifies the storage time period for deck in the phone's memory cache, which defaults to 30 days (unless memory runs out), The mobile phone is invoked directly from the cache for the deck accessed. If the information is time-sensitive, you can use Max-age to specify the lifetime of the deck in the cache, the smallest unit is seconds, and if you specify 0, each time you need to call the deck by connecting to the server.

and similar to the bookmark feature in the normal browser. When a user bookmarks a card, the mobile browser first records the card with a tag, which defaults to the title attribute in the label (which is discussed later), and then opens the URL that is logged when the user chooses the bookmark. However, because in the default case, the hand opportunity records all the deck, so the general is used to keep the phone from recording the current URL, that is,

4, template (template)

In order to save resources, you can set every card in the task to be used in the template, for the current deck all card use, add individual card does not need the template content, you can override it (see Task Shield).

5, cards (card)

Applicable events

The following events apply to card and template, as described earlier.

1. Onenterbackward
2. Onenterforward
3. OnTimer

Card Properties (cards)

ID: The unique identification of the card within the same deck, which can be used as a label. (#nextcard).

Title: Card titles. Different browsers deal with the title of the principle is not the same, some browsers will display the title, if the current card does not set the title, the current card URL will be displayed in the title position. Some browsers ignore headings to save the display area.

Newcontext: The default value is false to indicate that when jumping to this card, the phone is not to clear the previously retained information, including variables, the history of the stack, reset mobile phone status.

Ordered Boolean variable to declare whether the card is in order. Can often be used to develop an autoplay slide effect.

Example:

>





Start here.



!--override the same task in template-->

Card Accept





Card Accept2




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.