function profileGen(username, container) { queryAPIByUser("", username, (user) => { console.log(user); html = "
\ \

"+user.name+"

\

"+user.login+"

\

Followers: "+user.followers+"

\

Following: "+user.following+"

\ \

"+(user.bio != null ? "Bio: "+user.bio : "")+"

\

"+(user.location != null ? "Location: "+user.location : "")+"

\

"+(user.email != null ? "Email: "+user.email : "")+"

\

"+(user.blog != null ? "Site: "+user.blog : "")+"

\

"+(user.company != null ? "Company: "+user.company : "")+"

\

"+(user.organizations_url != null ? "Organizations: "+parseOrgs(user.organizations_url) : "")+"

\ "+user.html_url+" \

\
" $("#"+container).html(html); }, () => { console.error("error getting user info"); }); } function parseOrgs(oranization_url) { queryOrgUrl(oranization_url, (orgs) => { for (org in orgs) { console.log(org); } }, () => { console.error("error getting orgs"); }) } function queryOrgUrl(url, successCallBack, errorCallBack) { console.log(urlpath); $.ajax({ type:'GET', url: urlpath, crossDomain: true, dataType: "json", success: successCallBack, error:errorCallBack }); }