我正在使用一个使用bootstrap-notify的模板,我想从一个视图向它发送数据:
try:
# things
except Exception as e:
options = {
"icon": "glyphicon glyphicon-warning-sign",
"title": "Bootstrap notify",
"message": "Turning standard Bootstrap alerts into 'notify' like notifications",
"url": "https://github.com/mouse0270/bootstrap-notify",
"target": "_blank"
}
return JsonResponse(options)
在此示例中,消息正在显示,但“图标”和“标题”等所有其他选项都被忽略。
在 JS 中,做同样的事情看起来像:
$.notify({
// options
message: 'Hello World' ,
title: 'your title'
},{
// settings
type: 'danger'
});
关于如何解决这个问题的任何想法?