I'm looking to return the value from an ajax call which is inside a jquery function. I have this code but it returns undefined. Any help as to what I'm doing wrong is much appreciated.
$.inlDo = function(action,rec,val) {
    $.ajax({
        type: 'POST', url: 'editFile.php?do='+action+'&record='+rec+'&val='+val,
        success: function(d) {
            return 'ok';
        }
    });
}
alert($.inlDo('del',id,''));
The ajax call is successful so that's not likely to be the problem.
 
     
    