I tried the following code but nothing's popping up when I launch the page in my browser
$(function () { //ready
toastr.info('For more information, see our FAQ guide located below.');
});
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.
See the 'callbacks' section of the documentation: github.com/CodeSeven/toastr. Secondly, making an AJAX request then showing a notification is redundant if you're going to redirect anyway. Instead of making a single request you've made two and held up your user while they waited for the notification to go away.
If you've included jQuery, toastr.js, and toastr.css in your page, then this should work. I'd make sure to check to see if your path to these scripts are all correct, and I'd check the console for any 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 () { //ready
toastr.info('If all three of these are referenced correctly, then this should toast should pop-up.');
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With