Toastr
Toastr is a Javascript library for non-blocking notifications. We use toastr library for alerts like info, success,warning or error.
Quick Start
Toastr css and js files available in /libcommon/plugins/toastr
. These files already
included in
header
files of staffs and students.
See the below example to display an info alert
toastr.info('Capslock On');
Toastr Options
Example
//To display warning alerts
toastr.warning("Use strong password to protect your details");
//To display success alerts
toastr.success("Successfully completed your task");
//To display error alerts
toastr.error("Invalid credentials. Use valid credentials");
// Immediately remove current toasts without using animation
toastr.remove()
// Override global options
toastr.success('You have chooser success option!', 'Success', {timeOut: 5000});
If you want to add title for your alert message pass it as second parameter of toastr function. See the example.
toastr.success('Have fun storming the castle!', 'Miracle Max Says')
For more examples and details
Click Here