【发布时间】:2018-06-01 17:16:29
【问题描述】:
我想使用 toastr 来通知用户。我已按照this 指南进行设置。但我收到错误消息:Uncaught TypeError: toastr is not a function。我查看了网络选项卡,文件正在正确加载。尝试使用cdn确定。但没有运气。这就是我尝试使用它的方式:
toastr('Are you the 6 fingered man?');
与演示一样。关于我做错了什么有什么建议吗?
【问题讨论】:
-
这一行之前是否包含toastr脚本?
-
是的。并解决了它。必须像这样
Command: toastr["success"]("test message", "test")声明toastr。 -
因此,您可能希望发布自己问题的答案,详细描述问题所在以及需要采取哪些措施来解决问题,或者删除您自己的帖子。
标签: javascript jquery toastr