So we have this:
$.post('testeUpdate.php', 'someValue'
function(dadosResposta) {
$('#ns-nome').val(dadosResposta.nsName);
$('#ns-endereco').val(dadosResposta.nsAddress);
},
"json");
From client to server: Is sends 'sameValue' to testeUpdate.php using POST.
On success, it receives the data returned by the server side script and do something with that on the client side. Correct?
There is something between the Server Side script and this Client Side script that I'm not getting.
Question: How does dadosResposta gets filled with the data returned from the serverside script ? How does it knows? How does it work? Perhaps the question may also be posed: how do jquery knows when something is "on success" ?
Or trying on another way: The server side executes the script, returns some encoded data in json. Until here ok. After this, what happens? How do we jump into the client side part again?
[update] Trying again: I know that: dadosResposta contains whatever the server-side script returns my question is, HOW does it knows about that? How does he do that? [/update]
Thanks a lot, MEM