www.wapease.com ·新闻动态 ·技术专题 ·WAP开发 ·用户专区 ·企业专区 ·相关资源 ·网络知识
首页>WAP开发技术>WAP初级教程>正文    

6.3.2 ontimer事件、onenterforward事件、onenterbackward事件


WAP技术站:www.wapease.com  将本文推荐给你的QQ或MSN好友 加入收藏

6.3.2  ontimer事件
ontimer用于指定一个事件,当<timer/>标签指定的时间到期后,浏览器就执行ontimer所指定的这个事件。ontimer的事件可以是一个URL地址,一个卡片组,一个WML网页,一幅图像或其他符合URI定位规则的文件。<timer/>标签指定的时间为正整数,单位大小为1/10秒。

ontimer事件只能包含在card元素或template元素的标签中进行定义,其语法形式为:

 

<card  id="name"  title="label"  newcontext="boolean"  ordered="true"  onenterforward="href"

   onenterbackward="href"  ontimer="href"  >

        内容(content)

</card>

或:

<template  onenterforward="href"  onenterbackward="href"  ontimer="href"  >

      内容(content)

</template>

 

ontimer事件只有一个属性,即ontimer。它用于指定一个超链(href)的URL地址,当指定时间timer过期的时候,用户浏览器就会按照该超链(href)的URL打开相应的卡片。

下面给出的例子就包含有ontimer事件,指定当浏览器等待5秒钟后,显示http://wapserver/hello.wml

 

<card id="cardname" ontimer="http://wapserver/hello.wml" title="title">

         <timer value="50"/>

         <p>

                   Hello World!

         </p>

</card>

 

6.3.3  onenterforward事件
onenterforward事件仅当用户使用go任务或类似于go任务的任务来定位和浏览卡片时才可发生。设置onenterforward事件后,当用户进入当前卡片组时,浏览器就会定位onenterforward属性或<go/>标签中指定超链(href)的URL地址,并打开URL指定的卡片。

本新闻共5页,当前在第1页  1  2  3  4  5  

上一篇:6.3 事件及其元素
下一篇:6.3.5 onpick事件、onevent元素、postfield元素
Google
 
关于“6.3.2 ontimer事件、onenterforward事件、onenterbackward事件”的相关内容连接
·第六章 WML Script标准函数库(下)
·第六章 WML Script标准函数库(上)
·第五章 WMLScript脚本程序设计(下)
·第五章 WMLScript脚本程序设计(上)
·第四章 WML Script语法基础
·第三章 WML编程
·第二章 WML语言基础
·第一章 WAP Server = Web Server + Configuration
·专题:WML语言全垒打
·初识WAP

万易网(wapease.com)版权所有  服务声明

Copyright © 2003-2008 Wapease Network, All Rights Reserved