Example 1 — Example
Typical usage.
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.
console.log(typeof XMLHttpRequest);
console.log("xhr.open('GET', url); xhr.onload = ...; xhr.send();");Typical usage.
console.log(typeof XMLHttpRequest);
console.log("xhr.open('GET', url); xhr.onload = ...; xhr.send();");Check support.
console.log("XMLHttpRequest — verify browser/Node support");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