One way of working with $.post is like this
Code:
$.post(url, {parameters}, callback);
url is a string containing the (relative or absolute) URL to the server side script (PHP in your case)
parameters is a list of parameters. Example for you jspwd parameter
Code:
{'jspwd' : $('#pwd').val()}
The PHP script will then receive the parameter as $_POST["jspwd"]
callback is a function that will be executed after the request has successfully finished.
Code:
$.post('path/to/your.php', {'jspwd': $('#pwd').val()}, function(data) {
alert(data); // this will alert the output of the PHP script
});
Most importantly: $.post() starts an asynchronous request which means that the "Javascript program flow" will continue to execute even if the request is not yet finished. So if you have a construct like this
Code:
function whatever() {
$.post(...);
return true;
}
then the "return true" will be executed before(!) the request finishes.