Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
56
rated 0 times [  59] [ 3]  / answers: 1 / hits: 56040  / 9 Years ago, mon, april 6, 2015, 12:00:00

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>




More From » jquery

 Answers
76

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


[#67182] Friday, April 3, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristopher

Total Points: 58
Total Questions: 103
Total Answers: 102

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
;