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
 
     
     
    