WML教程7:WML的事件

WML教程7:WML的事件
WML 的事件
内部事件(Onevent)
相关属性:

type:内部事件的触发条件,当前浏览器状态满足触发条件时,浏览器就会触发这个条件下设置的Task,内部事件总共有4种触发条件。

1 ontimer 满足时钟设置的条件时,该条件成立。关于时钟设置问题,后面还有专门的说明。
2 onenterbackward 通过Prev或其他外部命令返回到当前Card,该条件成立。
3 onenterforward 当浏览器通过链接进入当前Card,该条件成立
4 onpick 在使用Option控件列表的时候,任何点击控件的行为都会触发本事件,包括选择和去掉选择。

示例:

 1<wml>
 2<!-- this deck can't use in Ericsson r320sc ,because r320sc haven't accept button-->
 3<card id="start">
 4<do label="next" type="accept">
 5<go href="#two"></go>
 6</do>
 7<p>This is the first card.</p>
 8</card>
 9<card id="two">
10<do label="next" type="accept">
11<go href="#three"></go>
12</do>
13<onevent type="onenterbackward">
14<go href="#temp"></go>
15</onevent>
16<p>This is the second card.</p>
17</card>
18<card id="three">
19<do label="back" type="accept">
20<prev></prev>
21</do>
22<p>This is the thired card.</p>
23</card>
24<card id="temp">
25<do label="start" type="accept">
26<go href="#first"></go>
27</do>
28<p>haha, you are lost!</p>
29</card></wml>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus