Answer the question
In order to leave comments, you need to log in
How to return json in ajax request with "async: true"?
How to return json in ajax request with "async: true" ?
Example with "async: false":
$.getText = function(text){
var result;
$.ajax({
url : 'lang.json',
async: false,
success:function(data) {
result = data[text];
}
});
return result
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question