my.disablealertbeforeunload(object object)
基础库 或更高版本; 且 支付宝客户端 10.2.60 或更高版本; 若版本较低,建议采取 兼容处理 。
支小宝客户端 支持
安诊儿客户端 支持
插件: 不支持。
主体: 企业支付宝小程序 、 个人支付宝小程序
关闭小程序页面返回询问对话框。
注意: 小程序凯发k8官方网娱乐官方首页调用此 api 无效。
object object
查看示例
属性 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
success | function | - | 否 | 调用成功的回调函数 |
fail | function | - | 否 | 调用失败的回调函数 |
complete | function | - | 否 | 调用结束的回调函数(调用成功、失败都会执行) |
fail 回调的参数为 object,error
属性为错误码,errormessage
属性为错误消息。
错误码 | 错误消息 | 凯发app官方网站的解决方案 |
---|---|---|
7 | has not found page when disablealertbeforeunload has been invoked |
请在 page.onready 以后调用。 |
8 | can not invoke disablealertbeforeunload at first page |
不支持在凯发k8官方网娱乐官方首页调用此接口,可通过 getcurrentpages |
9 | client not support disablealertbeforeunload |
当前客户端版本不支持此接口,可忽略此报错或酌情提示升级。 |
my.disablealertbeforeunload(object object)
success 回调参数
fail 回调参数
my.disablealertbeforeunload({
success: function(res) {
console.log(res);
},
fail: function(err) {
console.log(err);
}
});
{
"success": true
}
{
"error": 8,
"errormessage": "can not invoke disablealertbeforeunload at first page"
}