after converting array of names in array of url links users online , offline , names closed accounts ["https://link_1","https://link_2",name(for closed account),"https//link_3",...] through $.map method , the .getjson within that. i try apply $.each method condition within again, if element starts "http" applied .getjson method work json object of element (link) , add html values of properties( e.g. html+=json.name); if element doesn't start "http" add value of element (e.g. html+=value). doesn't work; html variable takes index , value within jquery.each, not json object of nested .getjson method. lost? channels=["https://link1","https://link2","name(for closed account)",....]; var html=""; $.each(channels,function(index,value){ // elements links if(value.substring(0,4)=="http"){ $.getjson(value,function(json){ html+=json.name; }); ...