page
The XMLHttpRequest Interface

The XMLHttpRequest object can   be used by scripts to programmatically connect to their originating server   via HTTP. 

[NoInterfaceObject]
interface XMLHttpRequestEventTarget : EventTarget {
  // for future use
};

[Constructor]
interface XMLHttpRequest : XMLHttpRequestEventTarget {
  // event handler attributes
           attribute Function onreadystatechange;

  // states
  const unsigned short UNSENT = 0;
  const unsigned short OPENED = 1;
  const unsigned short HEADERS_RECEIVED = 2;
  const unsigned short LOADING = 3;
  const unsigned short DONE = 4;
  readonly attribute unsigned short readyState;

  // request
  void open(DOMString method, DOMString url);
  void open(DOMString method, DOMString url, boolean async);
  void open(DOMString method, DOMString url, boolean async, DOMString? user);
  void open(DOMString method, DOMString url, boolean async, DOMString? user, DOMString? password);
  void setRequestHeader(DOMString header, DOMString value);
  void send();
  void send(Document data);
  void send([AllowAny] DOMString? data);
  void abort();

  // response
  readonly attribute unsigned short status;
  readonly attribute DOMString statusText;
  DOMString getResponseHeader(DOMString header);
  DOMString getAllResponseHeaders();
  readonly attribute DOMString responseText;
  readonly attribute Document responseXML;
};

出自W3C官方规范

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2021-06-22
  • 2022-02-07
  • 2022-01-14
  • 2022-12-23
  • 2021-06-05
  • 2021-05-17
猜你喜欢
  • 2022-12-23
  • 2021-12-11
  • 2021-12-05
  • 2021-12-07
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案