toastr没有定义

ont*_*ike 2 html javascript jquery toastr

加载页面时在开发人员控制台中收到以下错误:

未捕获的ReferenceError:未定义toastr

这是html内容.有人可以向我解释为什么toastr未定义?

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css">
</head>

<body>
  <p>Toastr TEST</p>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js">
  </script>
  <script scr="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.2/js/toastr.min.js">
  </script>
  <script>
    $(document).ready(function() {
      console.log("document.ready");
      toastr.info('document.ready');
    });

    $(window).load(function() {
      console.log("window.load");
      toastr.info('window.load');
    });
  </script>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

DrC*_*ord 10

你有一个脚本元素的src属性错误拼写为toaster.js文件,它应该是"src"但是"scr".

  • 非常感谢.很抱歉浪费每个人的时间!我本周应该加入stackoverflow!一旦它让我,我会接受答复.祝你有美好的一天. (3认同)
  • 很乐意提供帮助:D (2认同)