I want to make my prompt message a little bit more fancy or good. I am using PHP as my back-end in my project but I am only using a normal prompt alert after successful operations. I will not include all the code here only in the part of sweetalert js.
After successful update operation. I want to display an alert message using sweetalert swal after I updated the user profile and when I click the ok button in the swal it will refresh the page to see the changes.
echo "<script>swal('Successfully updated the profile!', 'Click ok to refresh the page.', 'success');
window.location='preschooler_profile.php?p_id=$p_id'</script>";
After the update operation everything works fine in the server. But the prompt alert swal by sweetalert won't popup. But when I tried to test the sweetalert in the top of my html file and its working. So no problem with the sweetalert maybe because of the window.location?
Looking for help. Thanks in advance.
Why don't you try echoing this instead?