【问题标题】:Cordova Dialog Plugin: insert HTML tags in notification.alert messageCordova 对话框插件:在 notification.alert 消息中插入 HTML 标签
【发布时间】:2017-08-11 02:57:45
【问题描述】:

我正在开发一个 Cordova 混合应用程序。我需要单击按钮并向用户显示自定义错误消息。但是,我意识到 Cordova 对话框插件,notification.alert() 正文消息不支持 HTML 标记。我可以知道如何将 HTML 标记添加到 notification.alert() 的消息正文中,以便在我的 Cordova 应用程序中有一个自定义的通知对话框吗?以下是我的代码。

function alertDismissed() {
    console.log("alert has been triggered and dismissed ");
}

navigator.notification.alert(
    '<html><h1>Error!!></h1><br><a>Source Code Error</a></html>',
    alertDismissed,
    'Asset Details',
    'Ok'
);

【问题讨论】:

  • 使用 HTML 和 Css 自行创建对话框,而不是使用 Cordova 对话框插件

标签: javascript android html cordova


【解决方案1】:

我认为您可以使用自己的 html 和 css 来显示弹出窗口,而不是使用 cordova 对话框插件

显示对话框的有用插件http://dev.vast.com/jquery-popup-overlay/

如果您使用 ionic 框架,这将很有帮助 https://ionicframework.com/docs/components/#alert

【讨论】:

  • 解决了我的问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-25
  • 1970-01-01
  • 2021-03-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多