弹出系统提示对话框
void plus.nativeUI.alert( message, alertCB, title, buttonCapture );
说明:
创建并显示系统样式提示对话框,可设置提示对话框的标题、内容、按钮文字等。 弹出的提示对话框为非阻塞模式,用户点击提示对话框上的按钮后关闭,并通过alertCB回调函数通知对话框已关闭。
参数:
- message: ( String ) 必选
提示对话框上显示的内容
- alertCB: ( AlertCallback ) 可选
提示对话框上关闭后的回调函数
- title: ( String ) 可选
提示对话框上显示的标题
- buttonCapture: ( String ) 必选
提示对话框上按钮显示的内容
返回值:
void : 无
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>nativeUI Example</title>
<script type="text/javascript">
// H5 plus事件处理
function plusReady(){
// 弹出系统提示对话框
plus.nativeUI.alert( "Plus is ready!", function(){
console.log( "User pressed!" );
}, "nativeUI", "OK" );
}
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
</script>
</head>
<body>
弹出系统提示对话框
</body>
</html>