As far as I've understood your problem, you need to use Ajax requests fom your Javascript code to controller. Something like this:
$(document).on('click', 'button.update', function () {
that = $(this);
$.ajax({
url:"/post/update",
type: "POST",
dataType: "json",
data: { /* here you collect your data from page */
"name": that.parent.children('.name-input').val()
},
async: true,
success: function (data)
{
console.log(data);
$('div#ajax-results').html(data.success);
}
});
return false;
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…