bootstrap-notify
bootstrap-notify copied to clipboard
Using plugin inside another function : $.notify undefined
When used the plugin this way, it works perfectly
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mouse0270-bootstrap-notify/3.1.7/bootstrap-notify.min.js"></script>
<script>
$.notify({
// options
message: 'Hello World'
}, {
// settings
type: 'danger'
});
</script>
but I want to define a javascript function that call the plugin, so as to define custom options for notify depending on usage I've been trying this
<script>
function sendNotification() {
$.notify({
// options
message: 'Hello World'
}, {
// settings
type: 'danger'
});
}
</script>
When calling the function from chrome devtools, it throws a $.notify is not defined error
can anyone let me know if this will work ..any work around is available
Very bad, I'm trying to do the same thing and it does not work anywhere. Definitely this is not going to solve, we will have to change plugins.