I am trying to make this function work. I think this function is pretty clear:
function FileExists(path){
    var result = false;
    $.ajax({
        url:    "http://mydomain.com/"+path,
        type:   "HEAD",
        success:
                function(){
                    result = true;
                }
    });
    return result;
}
I need an anonymous function that is called by the success of the ajax post to set the result variable that was defined inside the FileExists function to true so that I can return this value from the FileExists function. I think I need to close this, but they confuse me.
Please, help! Thank!
source
share