Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

toastr is not defined [closed]

Receiving the following error in developer console when loading the page:

Uncaught ReferenceError: toastr is not defined

Here are the html contents. Can someone please explain to me why toastr is undefined?

<!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>
like image 237
ontheroadmike Avatar asked Apr 06 '15 16:04

ontheroadmike


People also ask

What is Toastr notification?

toastr is a simple JavaScript toast notification library that is small, easy to use, and extendable. It allows you to create simple toasts with HTML5 and JavaScript like this: Simply include the files in your HTML page and write a simple line of code like this: toastr.


Video Answer


1 Answers

You have the script elemen's src attribute wrongly spelled for the toaster.js file, it should be "src" but is "scr".

like image 98
DrCord Avatar answered Oct 11 '22 00:10

DrCord