PhoneGap中navigator.notification.confirm的用法详解
navigator.notification.confirm('您确定要退出程序吗?', showConfirm, '退出程序', '确定,取消');
function showConfirm(button) {
if( button== ) {
document.removeEventListener("backbutton", eventBackButton, false);//注销返回键
navigator.app.exitApp();//退出app程序
}
}
用法:navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels]);
message:对话框信息。(字符串类型)
confirmCallback:按下按钮后触发的回调函数,返回按下按钮的索引(1、2或3)。(函数类型)
title:对话框标题。(字符串类型)(可选项,默认值为“Confirm”)
buttonLabels:逗号分隔的按钮标签字符串。(字符串类型)(可选项,默认值为“OK、Cancel”)
有上面代码可以看出,回到函数接收按钮返回值通过button即可。
转载请注明:http://www.tea119.com
PhoneGap中navigator.notification.confirm的用法详解的更多相关文章
- 教程-Delphi中Spcomm使用属性及用法详解
Delphi中Spcomm使用属性及用法详解 Delphi是一种具有 功能强大.简便易用和代码执行速度快等优点的可视化快速应用开发工具,它在构架企业信息系统方面发挥着越来越重要的作用,许多程序员愿意选 ...
- js数组中foEach和map的用法详解 jq中的$.each和$.map
数组中foEach和map的用法详解 相同点: 1.都是循环遍历数组(仅仅是数组)中的每一项. 2.forEach() 和 map() 里面每一次执行匿名函数都支持3个参数:数组中的当前项value, ...
- centos中crontab(计时器)用法详解
关于crontab: crontab命令常见于Unix和类Unix的操作系统之中,用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行.该 ...
- oracle中的exists 和 in 用法详解
以前一直不知道exists和in的用法与效率,这次的项目中需要用到,所以自己研究了一下.下面是我举两个例子说明两者之间的效率问题. 前言概述: “exists”和“in”的效率问题,涉及到效率问题也就 ...
- Apache中的Order Allow,Deny用法详解
本文讲述了Apache中的Order Allow,Deny用法.分享给大家供大家参考,具体如下: Allow和Deny可以用于apache的conf文件或者.htaccess文件中(配合Directo ...
- AngularJS中$timeout和$interval的用法详解
1. 先将$interval,$timeout,作为参数注入到controller中,例如rds.controller('controllerCtrl', ['app', '$scope','$htt ...
- [转]AngularJS中$timeout和$interval的用法详解
本文转自:http://www.cnblogs.com/moli-/p/5827618.html 1. 先将$interval,$timeout,作为参数注入到controller中,例如rds.co ...
- c++ 中pair类模板的用法详解
pair: 头文件:#include<utility> 类模板:template <class T1, class T2> struct pair 参数:T1是第一个值的数据类 ...
- Java 中 this 和 super 的用法详解
前言 这次我们来回顾一下this和super这两个关键字的用法,作为一名Java程序员,我觉得基础是最重要的,因为它决定了我们的上限,所以我的文章大部分还是以分享Java基础知识为主,学好基础,后面的 ...
随机推荐
- SQL Server 父子迭代查询语句,树状查询(转)
-- Get childs by parent id WITH Tree AS ( SELECT Id,ParentId FROM dbo.Node P WHERE P.Id = -- parent ...
- 用css3实现一个带缺口的圆圈(图)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- [LintCode] Move Zeroes 移动零
Given an array nums, write a function to move all 0's to the end of it while maintaining the relativ ...
- Color Processing 色彩处理
How to read and write pixel data Bitmap processing Image Stride Bayer Color Filter Pattern High-Qual ...
- Odoo Website 替换 谷歌地图为 百度地图
由于众所周知的原因,国内使用谷歌地图是件非常痛苦的事,更为接地气的做法是替换为百度地图. 模块地址参见群公告. 演示地址:http://timesup.cn:8069
- Why does this json4s code work in the scala repl but fail to compile?
I'm converting a json-like string into json, and the following code works in the scala repl import o ...
- Scala命令设置JVM参数的规则
Scala下设置JVM参数简单分析 Scala 启动shell脚本,简化后的scala REPL 启动命令大致如下所示: java -Xmx256M -Xms32M \-Xbootclasspath/ ...
- TFS任务更新
由于不熟悉TFS任务更新的操作,花了四五个小时一个个的新建任务.下图是部分更新的任务截图: 每个任务的估计时间为3~5小时,每位成员的任务总时长均为19~20小时. 项目完成需要的总时间为135小时.
- oracle 学习摘录
(1)oracle插入回车换行符 SQL>insert into A t(t.name) values('aaaaa'||chr(10)||chr(13)||'ccccc'); 已创建 1 行. ...
- NVelocity+Bootstrap tab控件 异常之
异常信息:Encountered "tings" at line 54, column 55.Was expecting one of: "(" ... ...