Example 1 — Quick demo
Core XMLHttpRequest.
JavaScript
console.log(typeof XMLHttpRequest);
console.log("xhr.open('GET', url); xhr.onload = ...; xhr.send();");How It Works
- open/send. Configure and start.
- onload. Handle completion.
XMLHttpRequest is the classic HTTP API. Prefer fetch for new code; XHR remains useful for progress events and legacy code.
| Topic | Summary |
|---|---|
basics | core XMLHttpRequest usage. |
console.log(typeof XMLHttpRequest);
console.log("xhr.open('GET', url); xhr.onload = ...; xhr.send();");Core XMLHttpRequest.
console.log(typeof XMLHttpRequest);
console.log("xhr.open('GET', url); xhr.onload = ...; xhr.send();");CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful