我可以在 html5 通知中显示超棒的字体图标吗
Can I display font-awesome icons in html5 notifications
我试图根据此文档 website.As 在我的 website.As 上显示桌面通知 here,我可以为图标 image.But 提供 URL 我的网站正在使用字体很棒的图标,因此我没有 URL 用于 icons.Any 帮助,否则将不胜感激
function spawnNotification(theBody,theIcon,theTitle) {
var options = {
body: theBody,
icon: theIcon //this should be a URL can I provide an icon class of a text content?
}
var n = new Notification(theTitle,options);
}
Fontawesome 图标是 png 格式的,您可以直接使用 URL 到图标图像。
您可以在您的服务器上托管您的图片
function spawnNotification(theBody,theIcon,theTitle) {
var options = {
body: theBody,
icon: 'http://yourdomain.com/icons/icon.png'
}
var n = new Notification(theTitle,options);
}
有关图标的更多信息,请参阅 here
我试图根据此文档 website.As 在我的 website.As 上显示桌面通知 here,我可以为图标 image.But 提供 URL 我的网站正在使用字体很棒的图标,因此我没有 URL 用于 icons.Any 帮助,否则将不胜感激
function spawnNotification(theBody,theIcon,theTitle) {
var options = {
body: theBody,
icon: theIcon //this should be a URL can I provide an icon class of a text content?
}
var n = new Notification(theTitle,options);
}
Fontawesome 图标是 png 格式的,您可以直接使用 URL 到图标图像。 您可以在您的服务器上托管您的图片
function spawnNotification(theBody,theIcon,theTitle) {
var options = {
body: theBody,
icon: 'http://yourdomain.com/icons/icon.png'
}
var n = new Notification(theTitle,options);
}
有关图标的更多信息,请参阅 here