Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$.notify is not a function with Bootstrap in MVC after ajax call

I want to show a notify when an ajax function completes. My ajax is good I just can't seem to get the notify to work. I have jquery and everything installed and I also have notify.js. From the Chrome console I came to know the below error

Uncaught TypeError: $.notify is not a function

And also I am getting my ajax response fine. Below is the code for notifying,

@if (TempData.ContainsKey("SuccessMessage"))
{
    <script>
        $.notify({
            message: '@TempData["SuccessMessage"].ToString()'
        }, {
            type: 'success',
            delay: 7000,
        });
    </script>
}

And below is the references added for the same,

<script src="/bootstrap/js/notify.js"></script>
<script src="/scripts/js/jquery.min.js"></script>

Let me know if I am making any mistakes

like image 344
best Avatar asked Nov 09 '16 15:11

best


1 Answers

Invert a declaration

<script src="/scripts/js/jquery.min.js"></script>
<script src="/bootstrap/js/notify.js"></script>
like image 60
Federico Zorzi Avatar answered Sep 21 '22 08:09

Federico Zorzi