$.post('testeUpdate.php', 'autocomplete',
function(dadosResposta) {
$('#ns-nome').val(dadosResposta.nsName);
$('#ns-endereco').val(dadosResposta.nsAddress);
},
"json");
I'm trying to understand this. So, and having the jquery $.post reference link near me:
1) A post request is send to testeUpdate.php, then, we can pass a string called 'autocomplete' . Precise?
Question 1) Passing a post request with that string, means that we can later, for example, process that request upon a conditional by specifically point to: $_POST['autocomplete']; ?
2) Later, we have a "on success" callback function what accepts a parameter, dadosReposta. Precise?
Question 2) This dadosResposta is something that may come from our server side script? Is this an argument having the data we receive?
3) So, on success, what we want to do is: populate some input element with some values. val(dadosResposta.nsName);
Question(s) 3) is this "dot notation" a way to access data on json format - or is this a way to walk on the DOM as we normally do? Is so, then what role is json playing here ?
Thanks a lot in advance, MEM