Answer the question
In order to leave comments, you need to log in
Why does yii2 on js ajax request give a minus status?
I do image deletion via ajax on js
Here is the function itself
function deletImage(id){
var request = new XMLHttpRequest();
request.open('POST','/item/delete-image?id='+id,true);
};
Answer the question
In order to leave comments, you need to log in
Try to debug manually: open the controller and put die('123') there, at the beginning, on the trail. line, etc.. You will find a place where everything stalls, or you will find that nothing is simply returned from the controller (response I mean)
Because in the browser you have a GET request, and you send a POST
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question