Page is a not externally linkable
shingokko - 5:51 am on Apr 22, 2012 (gmt 0)
OK, the problem is that the callback function of the AJAX call is inside valAgainstDataBase thus the value returned from the function is not used. I think it would work if you change it to:
function valAgainstDataBase(callback) {
$.post("ajax_works_v2.php", { username: $('[id=username]').val(), password: $('[id=password]').val()}, callback);
}
function chestLoginForm() {
valAgainstDataBase(function(data) {
alert('return value: ' + data);
});
}
Hope this works!