I get an 'EXPECTED POST' error in my console when I click the button. console.log(data)
is highlighted yellow. Presumably there is a JSON problem, but I could not find it.
var success_callback = function(data) {
console.log(data);
$('#results')[0].innerHTML = data;
}
$('button').click(function() {
$.ajax('ajax.php', {
data: {
submission: JSON.stringify({
prop: $('text_area').val()
})
},
success: success_callback
});
});
See Question&Answers more detail:os