跳到主要內容

東華-四維1000M/2023-10

學術網路對外流量即時監測

// 將網址替換為 Headers 頁籤中複製的 Request URL const COUNTER_API_URL = 'https://www.swsh.hlc.edu.tw/widget/visitor_counter/count_query_json.php?bid=2'; function fetchVisitorCount() { fetch(COUNTER_API_URL) .then(response => response.json()) .then(data => { // 將 JSON 數據填入您自己設計的 DOM 欄位 document.getElementById('online').innerText = data.online; document.getElementById('today').innerText = data.today; document.getElementById('yesterday').innerText = data.yesterday; document.getElementById('week').innerText = data.week; document.getElementById('month').innerText = data.month; document.getElementById('total').innerText = data.total; }) .catch(error => console.error('取得計數數據失敗:', error)); } // 頁面載入時執行 fetchVisitorCount(); // 可設定每 60 秒自動更新一次「線上人數」 setInterval(fetchVisitorCount, 60000);

數位學習iSchool數位平台線上學習如何編輯網站選單

消息公佈欄

時間類別單位標題發佈點閱
跳至網頁頂部