XMLHttpRequest:XMLHttpRequest() 建構子
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
備註: 此功能可在 Web Worker(不包括 Service Worker)中使用。
XMLHttpRequest() 建構子會建立一個新的 XMLHttpRequest。
語法
js
new XMLHttpRequest()
// 非標準
new XMLHttpRequest(options)
參數
此建構子沒有標準參數。然而,Firefox 允許一個非標準參數:
optionsNon-standard-
一個可以包含以下旗標的物件:
回傳值
一個新的 XMLHttpRequest 物件。在呼叫 send() 將請求傳送至伺服器之前,必須至少先呼叫 open() 來初始化該物件。
規範
| Specification |
|---|
| XMLHttpRequest> # dom-xmlhttprequest> |