Try with this code:
<script> function DeleteProduct(id,p_pdf){ toastr.success("<br /><br /><button type='button' id='confirmationRevertYes' class='btn clear'>Yes</button>",'Are you sure, you want to delete it?', { closeButton: false, allowHtml: true, onShown: function (toast) { $("#confirmationRevertYes").click(function(){ $.ajax({ url: "<?php echo base_url(); ?>admin/delete-product", type: "POST", data:{id:id,p_pdf}, success: function(res){ //console.log(res); if(res=="success"){ toastr.success("Done! Record delete successful.", 'Success!', {timeOut: 5000}); }else{ toastr.error("Opps! Something is wrong, Please try again.", 'Error!', {timeOut: 5000}); } } }); }); } }); } </script>
Question and answer is powered by AnsPress.io