I have sent a jquery-ajax request and it’s the response was true
but i need to change the value of a selected item on the page but neither the action takes place nor the the alert alerts
like :
$('#rename').click(function () {
//alert( $(this).closest('td').prev().prev().text());
var name = prompt('enter the new name');
if (name) $.ajax({
url: url() + '/rename',
type: 'POST',
data: { value: name,
id: $(this).closest('tr').find('td :first').attr('value')
},
success: function (result) {
if (result.content == 1) {
//location.reload();
alert(name);
//$(this).closest('td').prev().prev().text(name);
}
}
})
})
what do you think to overcome that issue ?
this should help you debug the issue
basically added a couple of extra points.
alert('success');How do you know it’s resturning success at all? Added
error: function () {
alert(‘error’);
}
you were missing a
;at the end. 🙂