草案
此页面不完整。
XMLHttpRequest()
构造函数创建新
XMLHttpRequest
.
对于细节关于如何使用
XMLHttpRequest
,见
使用 XMLHttpRequest
.
const request = new XMLHttpRequest();
None.
新的
XMLHttpRequest
object. The object must be prepared by at least calling
open()
to initialize it before calling
send()
to send the request to the server.
Firefox 16 added a non-standard parameter to the constructor that can enable anonymous mode (see
bug 692677
). Setting the
mozAnon
flag to
true
effectively resembles the
AnonXMLHttpRequest()
constructor described in older versions of the XMLHttpRequest specification.
const request = new XMLHttpRequest(paramsDictionary);
objParameters
mozAnon
true
will cause the browser not to expose the
origin
and
user credentials
when fetching resources. Most important, this means that
Cookie
will not be sent unless explicitly added using setRequestHeader.
mozSystem
true
allows making cross-site connections without requiring the server to opt-in using
CORS
.
Requires setting
mozAnon: true
, i.e. this can't be combined with sending cookies or other user credentials. This only works in privileged (reviewed) apps (
bug 692677
); it does not work on arbitrary webpages loaded in Firefox
XMLHttpRequest
XMLHttpRequest()