Materi
Roadmap
Proyek
Sertifikat
Skillance Code Lab
Jalankan »
Skillance Code Lab Editor
Editor
Hasil
Split
Editor Kode Sumber
Tekan
Ctrl + Enter
untuk Menjalankan
<!DOCTYPE html> <html> <body style="font-family: sans-serif; padding: 20px;"> <h2>Metode Klasik XMLHttpRequest</h2> <p>Sebelum adanya Fetch API modern, pengembang menggunakan XMLHttpRequest:</p> <pre style="background:#1e293b; color:#38bdf8; padding:15px; border-radius:8px;"> const xhr = new XMLHttpRequest(); xhr.open("GET", "https://api.example.com/data", true); xhr.onload = function() { if (xhr.status === 200) { console.log(xhr.responseText); } }; xhr.send(); </pre> </body> </html>
Hasil Tampilan (Browser Preview)
Muat Ulang