{{ async function fetchData() { try { const url = "https://fkhrzzhd.github.io/kamus-frame-semantik/data.json"; // Ganti dengan URL GitHub Pages Anda console.log("Mengambil data dari:", url); const response = await fetch(url); if (!response.ok) throw new Error(`Gagal mengambil data: ${response.status} ${response.statusText}`); const data = await response.json(); displayWords(data); } catch (error) { console.error("Error saat mengambil data JSON:", error); document.getElementById("wordList").innerHTML = "Gagal memuat data."; } } function displayWords(words) { const tableBody = document.getElementById("wordList"); tableBody.innerHTML = ""; if (!words || words.length === 0) { tableBody.innerHTML = "Data tidak ditemukan"; return; } words.forEach(word => { const row = ` ${word.kata} ${word.sinonim.join(", ")} ${word.kategori.join(", ")} ${word.asosiasi} `; tableBody.innerHTML += row; }); } document.addEventListener("DOMContentLoaded", fetchData); }}