jquery-3.2.1.min.js:4 POST http://localhost/Tareas/web/app_dev.php/task/process/3 500 (Internal Server Error)
send @ jquery-3.2.1.min.js:4
ajax @ jquery-3.2.1.min.js:4
r.(anonymous function) @ jquery-3.2.1.min.js:4
(anonymous) @ task-process.js:10
dispatch @ jquery-3.2.1.min.js:3
q.handle @ jquery-3.2.1.min.js:3
Este es el script:
Código Javascript:
Ver original
$(document).ready(function(){ $('.btn-process').click(function (e) { e.preventDefault(); var row = $(this).parents('tr'); var id = row.data('id'); var form = $('#form-update'); var url = form.attr('action').replace(':TASK_ID', id); var data = JSON.stringify(form.serialize()); $('#button-' + id).addClass('disabled'); $.post(url, data, function(result) { $('#button-' + id).removeClass('disabled'); if(result.processed == 1) { $('#message-warning').addClass("hidden"); $('#message').removeClass("hidden"); $('#glyphicon-' + id).removeClass('glyphicon-time text-danger').addClass('glyphicon-ok text-success'); $('#glyphicon-' + id).prop('title', 'Finish'); $('#user-message').html('The task has been finish.'); } else { $('#message').addClass("hidden"); $('#message-warning').removeClass("hidden"); $('#user-message-warning').html('The task was already finished.'); } }).fail(function () { alert('The task was not finished.') }); }); });
y me muestra el mensaje del fail y no sé cómo terminar con esto.
Espero sus respuestas y saludos.