Jump to content

MediaWiki:Common.js: Difference between revisions

From nUSA Wiki
m Protected "MediaWiki:Common.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
No edit summary
Line 11: Line 11:
}
}


window.onload = fetchMemberCount;
document.addEventListener('DOMContentLoaded', fetchMemberCount);

Revision as of 03:21, 3 January 2025

async function fetchMemberCount() {
    try {
        const response = await fetch('https://groups.roblox.com/v1/groups/758071');
        const data = await response.json();
        const memberCount = data.memberCount;
        document.getElementById('player-count').textContent = memberCount.toLocaleString();
    } catch (error) {
        console.error('Error fetching member count:', error);
        document.getElementById('player-count').textContent = 'unavailable';
    }
}

document.addEventListener('DOMContentLoaded', fetchMemberCount);