I have a function which returns another function which returns a boolean value, on this i do validation which is causing unusual behavior.
The code in the function is as follows:
$.post( "classes/InsertCustomer.php",
{ iResult: theResult.valid },
function(data)
{
alert(data);
});
return true;
When this runs, the post happens but doesn't return anything. However, when the last line is "return false" the post executes perfectly and returns the data from the PHP file. No change to the PHP code at all, just the return true and false in the JavaScript.
Is there any sensible reason for this?