uploadedImagesRefresh()
POST リクエストが成功したときにメソッドを呼び出そうとしています。コードは機能することもありますが、呼び出しに失敗することもありますがuploadedImagesRefresh()
、バックエンドは問題なく、Post リクエストは正常に完了していると言わざるを得ません。
function refreshUploadedImages() {//this
//function works quite well in other calls
}
$(function(){
//
$('.delete-img-btn').live('click', function() {
//asign the image id from the button attribute 'img-id'
var id= $(this).attr('img-id');
//The data to be send via ajax the server will recieve 2 POST variables ie. 'action' and 'id'(which is the img id)
var data={
'pk':id,
//call refreshUploadImages() upon succesful post
'success':refreshUploadedImages
};
//The ajax request.
$.post("/admin/image-uploader/delete/"+id , data);
});
});
上記のコードで何が間違っていますか?