Get to know MDN better
此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。
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。
此建構子沒有標準參數。然而,Firefox 允許一個非標準參數:
options一個可以包含以下旗標的物件:
mozAnon一個布林。將此旗標設為 true 會使瀏覽器在擷取資源時不暴露來源和使用者憑證。最重要的是,這表示除非使用 setRequestHeader 明確新增,否則不會傳送 Cookie。
mozSystem一個布林。將此旗標設為 true 時,請求將不會強制執行同源政策。
一個新的 XMLHttpRequest 物件。在呼叫 send() 將請求傳送至伺服器之前,必須至少先呼叫 open() 來初始化該物件。
| XMLHttpRequest # dom-xmlhttprequest |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年7月1日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.