If you included jQuery, toastr.js and toastr.css in your page, this should work. I would try to check if all the correct paths to these scripts were in place, and I would check the console for errors.
<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 () { </script>
source share