I am trying to delete a photo using ajax and when the photo is deleted show default image instantly, so far I am done with php side but the ajax part isn\'t working. How can I m
Try move "page= delete" in data secction:
function delete_image()
{
$.ajax({
type: "POST",
url: "target.php",
cache: false,
success: function(response)
{
var $divs = $("<div>" + response + "</div>");
$("#phd").fadeOut('slow');
$(".suc_pic").fadeIn('slow').empty().append($divs.find("#msg"));//the default picture fades in once the photo is deleted.
},
data: {page='delete'}
});
}