Ajax调用后通知

Notify after Ajax call

本文关键字:通知 调用 Ajax      更新时间:2023-09-26

希望这是一个很简单的问题我想在ajax函数完成时显示一个通知。我的ajax很好,我只是不能让通知工作。我有jquery和所有的安装,我也有通知。js从http://notifyjs.com/.

使用谷歌开发工具,我总是得到下面的错误。

Uncaught TypeError: $.notify is not a function
这是我的ajax函数。这工作得很好,我需要的只是没有通知显示:(
function MyAjaxFunction()
{
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            document.getElementById("mainpagemenu_myDiv").innerHTML = xmlhttp.responseText;
            $.notify("Hello World"); // <- **** this is the thing I want to do
        }
    }
    xmlhttp.open("POST", "/myaspfile.aspx", true);
    xmlhttp.send();           
}

我已经链接了我的文件

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script src="/bootstrap/js/notify.js"></script>

链接到下面的脚本

<script src="http://notifyjs.com/dist/notify-combined.min.js"></script>

在页面顶部(在使用Ajax函数之前)