Chạy ❯
Nhận trang web của
riêng
bạn
×
Thay đổi định hướng
Lưu mã
Thay đổi chủ đề, Tối/Sáng
Đi tới Không gian
<!DOCTYPE html> <html> <body> <h2>Nhận dữ liệu JSON từ máy chủ PHP</h2> <p>JSON nhận được từ tệp PHP:</p> <p id="demo"></ p> <script> const dbParam = JSON.stringify({"limit":10}); const xmlhttp = new XMLHttpRequest(); xmlhttp.onload = function() { document.getElementById("demo").innerHTML = this.responseText; } xmlhttp.open("NHẬN", "json_demo_db.php?x=" + dbParam); xmlhttp.send(); </script> </body> </html>