我尝试了以下代码,但当我在浏览器中启动页面时没有弹出任何内容
$(function () { //ready
toastr.info('For more information, see our FAQ guide located below.');
});
最佳答案
如果您的页面中包含了 jQuery、toastr.js、和 toastr.css,那么这应该可以工作。我会确保检查这些脚本的路径是否全部正确,并且我会检查控制台是否有任何错误。
<script src="/example-path-to/jquery-2.1.4.js"></script>
<script src="/example-path-to/toastr.js"></script>
<link href="/example-path-to/toastr.css" rel="stylesheet" />
<script>
$(function () { //ready
toastr.info('If all three of these are referenced correctly, then this should toast should pop-up.');
});
</script>
关于jquery - 调用时未出现 Toastr 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27954134/