它能够在公共(public)资源中显示提示框(“作为公共(public)资源预览”),但在 Android Emualtor 中不起作用。
原因是什么?
最佳答案
你试过吗using Cordova's navigator.prompt ?
例如,在common\main.js中:
function wlCommonInit() {
navigator.notification.prompt(
'Please enter your name', // message
onPrompt, // callback to invoke
'Registration', // title
['Ok','Exit'], // buttonLabels
'Jane Doe' // defaultText
);
}
function onPrompt() {
alert("prompted");
}
我在 iOS 中对此进行了测试,但它也适用于 Android。
预览应用程序时,请使用一些 stub 或“常规”JS 实现,但对于移动环境,请使用 Cordova 的实现。
关于javascript - IBM Worklight 6.1 - 如何显示提示对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22837521/