OGeek|极客世界-中国程序员成长平台

标题: javascript - 如何在适用于 ios 7 的 Cordova 3.9.2 中删除 index.html [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:17
标题: javascript - 如何在适用于 ios 7 的 Cordova 3.9.2 中删除 index.html

这是在 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 警报。

注意: 在这里,我没有调用任何原生功能,完全是用 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"]]);



Best Answer-推荐答案


要解决在警报中加载的标题名称, 我们也可以通过在javascript中使用自定义插件来使用另一种方法,所以不需要使用cordova plugins

在我的应用程序中,我使用了 SweetAlert javascript 插件。

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/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4