【发布时间】:2016-02-13 21:18:13
【问题描述】:
这里有个小问题。我认为解决方案很简单,我只是在监督一些事情。
所以,我的问题是,我试图在我的网页上使用 toastr.js。 到目前为止我得到了什么:
<link href="{% static "flat/css/toastr.min.css" %}" rel="stylesheet"/>
(显然指向 toastr.min.css 文件)和
<script src="{% static "flat/js/toastr.js" %}" ></script>
(指向 toastr.js 文件)。
现在就在</body> 之前,我有
<script type="text/javascript">
$(document).ready(function() {
toastr.options={"closeButton": false,"debug": false,"newestOnTop": true,"progressBar": true,"positionClass": "toast-bottom-full-width","preventDuplicates": false,"onclick": null,"showDuration": "300","hideDuration": "1000","timeOut": "5000","extendedTimeOut":"1000","showEasing": "swing","hideEasing": "linear","showMethod": "fadeIn","hideMethod": "fadeOut"};
toastr[success]("Message will come here", "Title");}
);
</script>
所以,我想使用 toastr 在页面加载时显示通知。 我该如何做到这一点?
【问题讨论】:
-
现在发生了什么?没有?有任何错误吗?不应该是
toastr.success("message will come here" ,"title");吗? -
@putvande 不,我完全没有错误
-
@putvande 和我已经尝试过 toast.success,但结果完全一样
标签: javascript html toastr