0

我已经在我的项目中包含了 jquery noty,但是我TypeError: self.options.theme is undefined在 js 文件的这一行中得到了以下错误,self.options.theme.style.apply(self); 我已经用谷歌搜索但没有成功。

  <script>
    $(document).ready(function () {

        $("#Send").click(function () {
            $.ajax({
                type: "POST",
                url: "RetrievePassword.aspx/SendNewPassword?email=" + $("#Email").val(),
                contentType: "application/json;charset=utf-8",
                success: function (result) {
                    //alert(result.d);
                    var n = noty({
                        text: 'A new password has been mailed', theme: 'default', layout: 'center', type: 'success', timeout: 3000, callback: {
                            onClose: function () {
                            }
                        }
                    });
                    window.location.href = 'Login.aspx';
                },
                error: function (response) {
                    var n = noty({ text: "An error occurred, either the email does not exists or is incorrect.", theme: 'default', layout: 'center', type: 'error', timeout: 2000 });
                }
            });
        });
    });
</script>
4

1 回答 1

1

确保包含 Noty 所需的所有 JS 文件,我怀疑您没有指定主题:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

<script type="text/javascript" src="js/noty/jquery.noty.js"></script>

<script type="text/javascript" src="js/noty/layouts/top.js"></script>
<script type="text/javascript" src="js/noty/layouts/topLeft.js"></script>
<script type="text/javascript" src="js/noty/layouts/topRight.js"></script>
<!-- You can add more layouts if you want -->

<script type="text/javascript" src="js/noty/themes/default.js"></script>
于 2013-07-01T13:01:29.823 回答