带有HTML标记的桌面通知(代码示例)? [英] Desktop Notification with HTML Markup ( code example )?

查看:109
本文介绍了带有HTML标记的桌面通知(代码示例)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这个问题,这对我非常有用。
Chrome桌面通知示例?
有什么方法可以通过 HTML 标记来自定义通知?以及该通知的自定义 CSS 样式

i read this question and this is very useful for me. Chrome desktop notification example? is there any way to customize Notification via HTML markup?? and custom CSS styling for that Notification

var notification = new Notification('Notification title', {
  icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
  body: "<h2>Hey there! You've been notified!</h2>"+
        "<span>this is another element</span>",
});

更新:还有另外一件事,如通知正文打击显示网址如何如果我要隐藏该网址

UPDATE : one more thing as notification body blow show web address how can hide that web address if i want to

推荐答案

您不能在邮件正文中使用HTML。但是您可以在警报正文中使用unicode标记(例如换行符,制表符等)。

You cannot use HTML in the body of the message. But you can use unicode markup in alert body for instance (such as newline, tab and so forth).

这篇关于带有HTML标记的桌面通知(代码示例)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆