javascript - 如何删除 ios 7 的 cordova 3.9.2 中的index.html

标签 javascript ios cordova

这是 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/

相关文章:

ios - 在后台运行代码

iphone - Web View 中的 YouTube - iPhone

javascript - 如何使用useState钩子(Hook)同时设置多个状态?

javascript - 为什么在 Vue.js 中对 src 链接使用字符串插值时不显示我的图像?

javascript - 在 Angular/.NET MVC 中发出发布请求后如何使用模型进行重定向?

html - 如何在 Cordova iOS 项目中更改文本字段光标颜色

javascript - 在 Vue-Router 的 Navigation Guards 中检测后退按钮

javascript - 如何记住点击的 href 并重定向到它 javascript

ios - 关闭 iOS 向后滑动

android - 动态创建 Cordova 构建(Android 和 iOS)