Sunday, 29 September 2019

Send data to bootstrap-notify from a backend code

I am using a template that uses bootstrap-notify and I would like to send data to it from a view:

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)

In this example the message is showing but all the other options like "icon" and "title" are being ignored.

In JS, doing the same thing looks like:

$.notify({
// options
message: 'Hello World' ,
title: 'your title'
},{
// settings
type: 'danger'
});​

Any idea on how to fix this?



from Send data to bootstrap-notify from a backend code

No comments:

Post a Comment