const url = "somePage.html"; // A local page
function load(url, callback) {
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
callback(xhr.response);
}
};
xhr.open("GET", url, true);
xhr.send("");
}XMLHttpRequest: response property / notebook
XMLHttpRequest: response property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.