Jump to content

MediaWiki:Vector.js: Difference between revisions

From nUSA Wiki
Created page with "async function fetchMemberCount() { try { const response = await fetch('https://groups.roblox.com/v1/groups/758071'); if (!response.ok) { throw new Error('Failed to fetch data'); } const data = await response.json(); console.log(data); // Log the entire data to check if it contains memberCount const memberCount = data.memberCount; document.getElementById('player-count').textContent = memberCount.toLo..."
 
m Protected "MediaWiki:Vector.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
async function fetchMemberCount() {
    try {
        const response = await fetch('https://groups.roblox.com/v1/groups/758071');
        if (!response.ok) {
            throw new Error('Failed to fetch data');
        }
        const data = await response.json();
        console.log(data); // Log the entire data to check if it contains memberCount
        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);

Latest revision as of 03:31, 3 January 2025