ASP technology in WAP (2)
Author:Eve Cole
Update Time:2009-05-30 19:54:47
<<<Previous page
WML basic language
"p" element
The function is the same as HTML, but it is necessary if you want to display text.
"do" element
Virtually every WAP application must support navigation bars. The value of the main type attribute of the do tag is accept, which means that when you press the soft key, a new option will be added to the list. The label attribute specifies the text to be displayed. Also some options:
go - Navigate to another card or section. He requires the href attribute.
prev - Navigate to the previous card
refresh - Refresh the display.
noop - None
Anchor
It has the same function as <A> in HTML. The function of Anchor link in WML is similar to that of do. The only difference is that Anchor is not displayed as an option.
<anchor>
Go to card 2
<go href="#card2"/>
</anchor>
variable
The way WML combines variables is a little different from HTML and Javascript. WML variables can not only be called by WMLScript, but can also be used directly in WML documents through cards. In other words, variables can not only be entered directly by the user, but can also be set by the setvar element. Of course variables can be manipulated by scripts, but this is not necessary! This point must be further emphasized and clarified. For example, you may need a card to get the user's name, and the next card will display "Hello, flying knife". We can do this like "Hello, $(firstname)", which is a bit like PHP. Isn't this in traditional HTML? It is impossible to achieve!
Since the values of variables can be saved between cards, they are often used to save status information and support some complex interactive WAP services. One problem with this approach is that this state may not be in sync with the user's browsing when the entire deck has to be re-referenced. Therefore, some events and properties are used to capture these events (onenterofrward and onenterbackward). Refresh is used to update the card based on the value of some variables.
user input
Of course, in order to make your page more powerful, variables need to store (receive) the user's standard input. This is all done through some HTML-like elements.
input - Much like HTML, the user inputs via the phone's keyboard. As you can imagine, this kind of input is not as practical as using the keyboard on a PC, so we should try to simplify this input method and possibly use select elements for users to choose. The name attribute is the name of this variable, and the default value and size attributes are obviously required. format specifies an input mask for the input entry. Please check other information for other information, I won’t go into them one by one here!
select/option - a list of user options. Also very similar to HTML:
<select name='movie'>
<option value='1'>Eyes Wide Shut</option>
<option value='2'>Notting Hill</option>
:
<option value='13'>Buena Vista Social Club</option>
</select>
The multiple=true attribute tells the user agent (browser) that multiple selections are allowed. The onpick event occurs when an option is selected/cancelled.
Postfield - Much like the hidden attribute in html, it will not be displayed on the screen. It can send name and value to the server at the same time.
Fieldset - Contains a lot of information that forces the phone to display on one screen. Of course, this depends on the capabilities of the phone.
other elements
The img element is also supported, but you have to use a special image format called WBMP. Because WAP phones have limited memory and storage space. This new format allows WAP devices to quickly understand and generate images. The generation of Wireless bitmaps can be accomplished by downloading a plug-in for Photoshop and Paint Shop Pro. Finally, everyone should remember to set the correct MIME type on your server. Below I have listed all WAP-related MIME:
wml text/vnd.wap.wml
wmlc application/vnd.wap.wmlc
wmlsc application/vnd.wap.wmlscriptc
wmlscript text/vnd.wap.wmlscript
ws text/vnd.wap.wmlscript
wsc application/vnd.wap.wmlscriptc
wmls text/vnd.wap.wmlscript
wbmp image/vnd.wap.wbmp
Some traditional emphasis elements are also supported, such as: em, i, b, small, strong, etc., and their usage is the same as in HTML. BR is also supported, but the writing method is a little different. After all, it is XML. It should be written like this<br />
Finally, let's take a look at the time object and ontimer event. The time object saves the time until the card is called. If we set the ontimer event, then the ontimer event will be fired.
There are many more that I am too lazy to write, and I hope it will not have any impact on you building WML web pages.
WAP development issues
Unfortunately, things are not as simple as we think. Different WAP phones always have some small differences, just like the Javascript of M$ is different from that of NS. For example, the NoKia 7710, the first WAP phone sold in Norway, did not support the POST method correctly.
Another limitation is the size of the deck. Some mobile phones (Nokia 7110) simply do not support WML documents larger than 1.4K. The WAP gateway can compress your WML documents into a smaller binary format, but you should not hope for a miracle. At this time, not only the stuff supported by Nokia 7110 cannot be displayed, but some highlighted flags are also ignored.
The fieldset flag is easily ignored by it, isn't it annoying! ? Hehe, when you create a very cool page on the emulator and then look at it on the mobile phone, hehe, smashing the phone is your first choice.
Although the Nokia Toolkit 1.2 emulator supports cookies, the first batch of WAP phones do not support it. This means that you will say goodbye to the Session in your ASP, at least for a long time.
In the next section, we will actually make a website that combines WML and ASP.