Ajax in a function, how return result?

Ajax in a function, how return result?

Hi,

I make an ajax call from a function and want to return the result (if success). What is the best way to do it? If I do async ajax call, my function returns nothing (well, not the result of ajax call). If I do sync ajax call, Firefox says we should not use sync calls any more.