но в сообщении публикуется [объект][объект] вместо значений
Вот мой код< /p>
Код: Выделить всё
$(".action").click(function(){
var dataId = $(this).attr("data-id");
var action = $(this).attr("name");
console.log(action);
$("#dataId").val(dataId);
swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false },
function (isConfirm) {
if (isConfirm) {
var url='ajax/admin_zones.php';
$.ajax({
url: url,
dataType: 'json',
data:{ZoneId: dataId},
contentType: false,
processData: false,
type: "POST",
success: function(data) {
//$("#response").html(data);
var response = data;
//alert(response);
var obj_response = JSON.parse(response);
var response_status = obj_response["status"];
var response_error = obj_response["error"];
if (response_status === false) {
//alert(response_error);
swal({
title: 'Failed..!',
text: response_error
});
}
if (response_status === true) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
var response_error = obj_response["code"];
$("#response").html(response_error);
}
setTimeout(function() {
$('.splash').hide();
}, 1000);
}
});
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
});
Подробнее здесь: https://stackoverflow.com/questions/791 ... thout-form