I have problem with jQuery Ajax calling method success. I tried everything but success is not calling. My code looks like
$('#target').submit(function(event) {
// get the form data
var formData = {
'name': $('input[name=name]').val(),
'surname': $('input[surname=surname]').val(),
};
// process the form
$.nette.ajax({
type: 'POST',
url: {link Admin:uploadData},
data: formData, // our data object
dataType: 'json',
async: false,
contentType: "application/json",
off: ['unique'],
success: function(payload){
console.log(payload.message.lol);
}
})
event.preventDefault();
});
I am using nette web framework. When I debug code in Firefox I get a response like this:
Tkanks for the advice.