Skip to content Skip to sidebar Skip to footer

Ajax Request Without Data Not Working

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 make

Solution 1:

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'}
        });

    }

Post a Comment for "Ajax Request Without Data Not Working"