← 返回教程列表
🔄 AJAX 教程
AJAX 简介
什么是 AJAX
AJAX 允许网页异步更新,无需重新加载整个页面。
var xhr = new XMLHttpRequest();
xhr.open("GET", "/api/data", true);
xhr.onload = function() {
console.log(JSON.parse(xhr.responseText));
};
xhr.send();AJAX 允许网页异步更新,无需重新加载整个页面。
var xhr = new XMLHttpRequest();
xhr.open("GET", "/api/data", true);
xhr.onload = function() {
console.log(JSON.parse(xhr.responseText));
};
xhr.send();