I'm having a problem with method using $.getJSON. It's very simple and it looks like that:
function lastID(query) {
$.getJSON(url+query ,function(json){
var type_id = json.data;
});
return type_id // doesn't work
}
Could you please tell me how to return type_id to some other value for instance like this:
var returnedID = lastID(query); // this schould me equal to returned type_id from lastID method.
Many thanks for your reply
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…