guys, i am using Toastr Notification (jquery Plugin) whenever user updates record it shows notification of success alert using plugin but problem is that whenever I update record it shows error in the console of the browser
**Uncaught ReferenceError: success is not defined** my alert code is <?php if($update_recored) { ?> <script> Command: toastr[success]("Record Updated", "Successfully Updated"); </script> <?php } ?>
Advertisement
Answer
I have no knowledge of Php but i can help you in jquery.
Please see below code.
<link href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script> $(document).ready(function(){ toastr.success("Record Updated", "Successfully Updated"); }); </script>