这是 Cordova 应用程序中显示的警报
alert("welcome to all");
当我在 ios 7 中运行该应用程序时,它显示
index.html
welcome to all
要删除index.html
,我使用了cordova插件cordova-plugin-dialogs
document.addEventListener("deviceready",alert,false);
function alert(){
navigator.notification.alert("welcome to all");
}
但这对我不起作用
请告诉我们一些细节,以在 ios cordova 应用程序中显示 native 警报。
注意: 在这里,我没有调用任何 native 功能,完全是仅用 HTML、JavaScript 开发的应用程序。只是我们维护了platforms/ios/www文件夹中的所有内容。当我开始在 iPhone 6 设备或模拟器上运行该应用程序时,它会按照 https://www.dropbox.com/s/st5jpq4r0hq0fqk/alert.png?dl=0 显示警报。
最近当我执行该应用程序时, 我收到的消息
The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "", "",[null,"Notification","alert",["HI am doing testing in alert","Good Job1","Okay1"]]);
最佳答案
要解决警报中加载的标题名称,
我们还可以使用另一种方法,即在 javascript 中使用自定义插件,因此不需要使用 cordova 插件
。
在我的应用程序中,我使用了 JavaScript 中的 SweetAlert
插件。
SweetAlert
插件
http://t4t5.github.io/sweetalert/
将该插件集成到我们的应用程序中非常容易。
集成后,我们就可以用这种格式传递消息了
swal("Displaying new message using SweetAlert plugin");
关于javascript - 如何删除 ios 7 的 cordova 3.9.2 中的index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35077684/