docs.rodeo

MDN Web Docs mirror

XMLHttpRequest

{{APIRef("XMLHttpRequest API")}}  {{AvailableInWorkers("window_and_worker_except_service")}} 

XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing.

{{InheritanceDiagram}} 

Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML.

If your communication needs to involve receiving event data or message data from a server, consider using server-sent events through the {{domxref("EventSource")}}  interface. For full-duplex communication, WebSockets may be a better choice.

Constructor

Instance properties

This interface also inherits properties of {{domxref("XMLHttpRequestEventTarget")}}  and of {{domxref("EventTarget")}} .

Non-standard properties

Instance methods

Events

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN