12. What is a "deck"?
A WML document consists of many cards. A card is a complete series of WML code. These cards are called a "deck". The concept of cards and "deck" is a bit like the anchor tag in HTML and an HTML page. That is to say, the card is an integral part of the "deck". "deck" can also be called a page in WML. The relationship between them can be compared to making a deck of playing cards. The whole deck of playing cards is deck, and each card is a card.
13. What is the "deck" of WML?
The "deck" or WML file of WML refers to decks. Each deck contains one or more cards. Each deck starts and ends with <wml>. And each card starts or ends with <card>.
When the WML microbrowser processes WML files or decks, it reads the entire deck and navigates between the various cards within the deck. When loading the deck, all the cards in the deck have been loaded into memory until the browser loads another deck.
If you are familiar with the <a name> tag in HTML. The WML <card> tag will be very similar:
<wml>
<card >
...some code...
</card>
<card >
...some more code...
</card>
</wml>
deck and card can be called in this way: [deckname][#cardname]. If deckname is omitted, the browser will look for the cardname name in the current memory. If deckname and #cardname are used, the browser will load the entire deck of the deckname and jump to #cardname. This works very much like HTML.
14. Is WML case sensitive?
Yes! Note that WAP 1.1 uses lowercase tags.
15. How to display a dollar sign?
Use two dollar signs together to represent them, i.e. "$$".
16. What should I do if I want to display the format of the price?
"$" is a special character, and "$$" is used to display a "$".
For example:
<p>
The price is $$11.20
</p>
17. What is the function of the fieldset tag?
When writing WML pages, consider that the device's screen is very small. If you try to display a large form on a screen, you must specify those tags to keep in one screen. Then the fieldset tags bundle these tags on a single screen.
18. What is the function of postfield tags?
The postfield tag allows the submission of parameters to the server side. Note that some early emulators did not support this tag, which would cause trouble for development work!
19. Does WML have HTML-like <mailto> tags?
No. But you can use WML forms and server-side scripts to get the same effect.
20. What's wrong with not being able to make the <input/> format work normally?
At least Nokia WML Reference did not explain clearly the usage of <input/> tags. The format parameter controls the type and length of data input by the user.
Noting that not all WAP 1.1 browsers accept all formatting codes. For example: Nokia 7110 is not very supportive. Mitsubishi Trium has some problems when dealing with the "*f" code, and the "*" must be 1 or greater. The special formatting code is as follows:
A
Any capital letters from A to Z, no numbers or other characters.
a
Any lowercase letters from a to z, no numbers and other characters.
Any number from 0 to 9.
X
Any character from A to Z from 0 to 9.
x
Any character from a to z from 0 to 9.
M
For any character, input starts in capital by default.
m
For any character, input starts in lowercase by default.
*f
(Asterisk) means any number (including 0), and f is the format code.
nf
Means the number of characters to be entered. n from 1 to 9. f is the format code.
\
is an escape output character.
Formatted characters can be used in combination to represent a specific format input. However, forcing certain inputs should avoid not prompting messages when the user makes an error. If the input is incorrect, the area to be filled in will generally remain blank until the user knows what to enter. If you want to enter only numbers, use "*N" then you will jump directly to digital input mode. If you want to enter only capital characters, use "*M" to jump to capital input mode. Here are some examples:
"N" only accepts one numeric character.
"*N" accepts any numerical character.
"NN" only accepts 2 numeric characters, no more or less.
"ANN" accepts a capital character (no number), followed by two numbers, no more or less.
"X*N" means that one character (no number) can be accepted followed by as many numeric characters.
"NNN\-NNN\-NNN" means accepting the US phone number format, such as: "123-456-1234".
"2N\:2N\:2N" means accepting time format, for example: "12:02:34".
"NNNNNNNNNNN" means accepting 9 numeric characters.
"9N" also means accepting 9 numeric characters.
The maxlength parameter controls the total number of input characters.
21. How to prevent an empty field?
In most cases, you need to know that the user is indeed entering some content in the field and cannot make these content empty. This can be done through server detection or WML.
In WML, this check can be done with appropriate formatting code, or using a parameter called emptyok="false" in the input tag (only used when user input must be required). If value="something" or value="" is used, the user can still send empty fields.
The following line will receive any value to the username field, and even the user clears the entire field. In addition, there is nothing in the field, and the form can be submitted.
<input name="username" type="text" value="things" format="*M"/>
Except for the user clearing the entire field, the following line will receive any value to the username field. If the field is empty, it will not be able to submit the form.
<input name="username" type="text" value="things" format="M*m"/>
The above applications are for most browsers. In Nokia 7110, the emptyok parameter can have the same effect:
<input name="username" type="text" value="things" format="*M" emptyok="false"/>
22. What should I do if I cannot display it on one screen when using the option tag?
Many WAP phones only have three to four options to display on the display screen. You can enter more options by dividing the option field as follows.
<select title="longselectlist">
<optgroup title="option1">
<option>option1-1</option>
<option>option1-2</option>
<option>option1-3</option>
</optgroup>
<optgroup title="option2">
<option>option2-1</option>
<option>option2-2</option>
<option>option2-3</option>
</optgroup>
<optgroup title="option3">
<option>option3-1</option>
<option>option3-2</option>
<option>option3-3</option>
</optgroup>
</select>
23. Want to have a permanent BACK in the lower right corner of the screen. Some seem to be automatic, but if not, what should I do?
The following code can be added.
<do type="prev" label="Back">
</prev>
</do>
Better yet is to use template.
……
<template>
<do type="prev" label="Back" name="back">
</prev>
</do>
</template>
……
24. Is the WAP support list?
Yes, WAP1.1 supports lists and related tags.
25. Can forms be used in WML?
Can. However, Nokia 7110 has some problems when displaying the form.
26. What kind of form submission method does WML support?
WML supports GET and POST methods. However, Nokia 7110 has some problems when dealing with GET methods.
27. How to add parameters to URL strings in WML?
It works very similarly to HTML, as shown below:
……
/someurl?parameter1=value1¶meter2=value2
……
The only difference is to turn "&" into "&".
28. How to transfer data from WML to ASP?
Suppose there is an ASP called "", and there is a WML variable called "wmlvar". When a request "?wmlvar=something" is issued, you can use the following method to obtain the content of the variable.
dim aspvar
aspvar = ("wmlvar")
The ASP variable "aspvar" will contain the string "something". Of course, ASP variables can also have the same name as WML variables.
29. How to make WML pages update themselves?
People who have web experience like to use:
<meta http-equiv="refresh" content="1;/">
To force the browser to update automatically.
Although some META tags are also supported in WAP, a better way is to use the <ontimer> tag.
The following code shows how to automatically jump to another card:.
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1.">
<wml>
<card ontimer="">
<timer value="40"/>
<p>Please wait for the timer to run out...</p>
</card>
</wml>
The following code will force the browser to reload the same card after a period of time. This page is called.
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1.">
<wml>
<card ontimer="">
<timer value="40"/>
<p>This text will be shown over and over again...</p>
</card>
</wml>
Be careful to avoid the cache mechanism that the browser may use.
Previous page123Next pageRead the full text