0

Given this (which for brevity, I have trimmed out all the .ajaxSetup()/.fail()/URL creation, etc, which all work fine):

function isGoodPIN(pin) {

    var result = "";

    :
    :

    var ajaxResponse = $.get(
        cURL,
        function (data) {
            result = (data=="OK"? true: false); 
            // result is local to .get() here...
        }
    )

    :
    :

    //... so result is "" here.
    return (result);  

}

Is there a way to get the value of result from inside the .get() call's callback function to result in the isGoodPIN() function?

KWallace
  • 1,570
  • 1
  • 15
  • 25
  • Wow! Pointy! That's almost a carbon copy duplicate. How did you know that? Did you just memorise every SO post on the site? ;-) THANKS! – KWallace Mar 15 '16 at 18:07
  • Jimminy, it's so similar, right down to the placement of the comments explaining things..... Maybe I am just a reincarnation of Felix Kling after too many vodka and tonics. ;-) – KWallace Mar 15 '16 at 18:07

0 Answers0