Welcome Guest, Not a member yet? Register   Sign In
[solved] don't understand javascript variable scope; now talking about validation plugin
#3

[eluser]danmontgomery[/eluser]
move the result declaration outside of the function.

Code:
var result = false;
function name_free(value, element) {
    if(something) {
        $.post('something', { foo: bar }, function(data) {
            if(data == 'true') result = true;
        }
    }
    console.log(result);
    return result;
}


Messages In This Thread
[solved] don't understand javascript variable scope; now talking about validation plugin - by El Forum - 01-25-2011, 08:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB