2013-07-01 16 views
0

我已經包括jQuery的noty但我得到以下錯誤TypeError: self.options.theme is undefined在js文件self.options.theme.style.apply(self); 我用Google搜索,但沒有成功這行。類型錯誤:self.options.theme未定義在我的項目

<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> 

回答

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> 
+0

這是我引用: < script src =「Scripts/noty/layouts/center.js」> – Gericke

+0

你可以發函後於何處此代碼位於我可以看一看? – danielrsmith

+0

我試圖看到正在生成的實際錯誤,不能僅僅通過源代碼來實現。 – danielrsmith