ASP technology in WAP (II.)

Source: Internet
Author: User
Tags variables
Flying Enet College

WML Basic Language

"P" element

Functions like HTML, but if you want to display text this is a must.

"Do" element

In fact, each WAP application must support the navigation bar. The value of the main type attribute of Do label is accept, which means that when you press the soft key A new option is added to the column
Table. The Label property specifies the text to display. There are also some options:

Go-Navigate to another card or plate. He needs the href attribute.

Prev-Navigate to the previous card

Refresh-Refreshes the display.

NoOp-None

Anchor

function is the same as <A> in HTML. The anchor link in WML has the same effect as do, and the only difference is that anchor is not displayed in the form of an option.

<anchor>

Go to Card 2

<go href= "#card2"/>

</anchor>

Variable

The WML binding variable is a bit different from HTML and JavaScript. The WML variable can be invoked not only by WMLScript, but also by the card directly to the WML
File. In other words, variables can be entered not only by the user, but also by the setvar element. Of course variables can be manipulated by scripts, but this is not necessarily
Of This point of view must be further emphasized and clarified. For example, you may need a card to get the user's name, and the next card will show "Hello, flying knife" and I
We can do this "hello,$ (FirstName)", a bit like PHP, is not, this in the traditional HTML is impossible!

Since the values of variables can be saved between the card, they are often used to save state information and support some complex, interactive WAP services. This method of a
The problem is that when the entire deck has to be referenced again, these states may not be synchronized with the user's browsing. So, some events and properties are used to capture these events
(Onenterofrward and Onenterbackward). Refreshes are used to update the card based on the values of some variables.

User input

Of course, to make your page more powerful, variables need to store (receive) the user's standard input. This is done through some HTML-like elements.

Input-much like HTML, the user enters through the keyboard of the phone. As you can imagine, this input is not as practical as the keyboard we use on the PC, so we should try to
By simplifying this type of input, it is possible to use the Select element as much as possible for the user to choose. The Name property is the variable, and the default value and size attribute are clearly also
Of The format specifies an input mask for the input entry. Others, please check other information, I will not tell each of them!

Select/option-a list of user options. It's also like HTML:

<select name= ' movie ' >

<option value= ' 1 ' >eyes Wide shut</option>

<option value= ' 2 ' >notting hill</option>

:

<option value= ' >buena Vista Social club</option>

</select>

The Multiple=true property tells the user that the proxy (browser) multiple selections are allowed. The Onpick event occurs when an option is selected/canceled.

Postfield-Much like the hidden attribute in HTML, it will not appear on the screen. It can transmit name and value to the server at the same time.

FieldSet-Contains a whole bunch of information to force the phone to appear on a screen, but it depends on the phone's ability.

The other elements

The IMG element is also supported, but you have to use a special picture format called Wbmp. Because WAP phones have limited memory and storage space. This new format can
Enough to allow WAP devices to quickly understand and generate pictures. The generation of Wireless bitmaps can be done by downloading a Photoshop and Paint Shop Pro Plugin
It's settled. Finally, remember to set the correct MIME type on your server, and I'll list all the 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, and so on, as well as HTML. BR is also supported, but the wording is somewhat different, after all
is XML, to write such <br/>

Finally, let's look at the time object and the OnTimer event, which holds until the card has been called to date, if we set the OnTimer event, then OnTimer
The pieces will be fired.

There are a lot of things I'm too lazy to write about, and I hope you don't have any impact on building WML pages.

The development problem of WAP

Unfortunately, things are not as simple as we think, and different WAP phones always have some small different places, just like m$ JavaScript and NS are not the same
Sample. For example, the first WAP phone sold in Norway, such as NoKia 7710, does not support the Post method correctly.

Another limitation is the size of the deck problem. Some handsets (Nokia 7110) do not support more than 1.4K of WML documents, and WAP gateways can compress your WML documents into more
Small binary format, but you don't want miracles to happen. At this time not only is the Nokia 7110 support of the Dongdong can not be displayed, some of the emphasis is also ignored, the other
FieldSet logo is also very easy to ignore it, is not very annoying!? Hey, when you make a cool page on the emulator, and then on the phone, look, hey, hit
The mobile phone is your first choice.

Although the Nokia Toolkit 1.2 emulator supports cookies, the first WAP phone is not supported, which means that you will be in session with your ASP and say
See, at least for a long time.

In the next section, we'll really do a Web site that combines WML with ASP.



Related Article

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.