How to make it when function success redirect user to index page to show message on the page that deletion was successful? So far I was able only to redirect user
$.ajax({
type: 'get',
url: 'lessonDel.php',
data: 'ajax=1&delete=' + upload_id,
success: function()
{
window.location.href = 'index.php';
//alert('You successfully deleted this Lesson! Status = ' + xhr.status);
}
});
change window.location.href = 'index.php#lessondelete';
in your index page :
$(function(){
var hash = window.location.hash
if(hash == "#lessondelete") {
alert('You successfully deleted this Lesson!');
//$('body').prepend('<p>You successfully deleted this Lesson</p>')
}
});
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