function parseUser(user) { const html = `
${user.firstname + ' ' + user.lastname} Joined ${parseDate(new Date(user.date))} Gender: ${user.gender} Birthday: ${parseMonth(user.month) + ' ' + user.day + ', ' + user.year} User ID: ${user.user_id}
` return html } function render() { const html = `
${data.users.map(u => parseUser(u)).join('')}
` append(html) const load = `
Load more users
` append(load) } var page = 0 var data = { users: [] } async function loadMore() { let users = await load() const users_block = document.getElementById("users") for (user of users) { append(parseUser(user), users_block) } } async function load() { const users = (await loaduserspage(page)).json if (users.length === 0) { page = -1 remove('load') } else { page++ } return users } async function init() { let users = await load() data.users.push(... users) render() } header(false, true) init()