Fetch 是一個新的 API,可更輕鬆地「擷取」遠端資源。和 XMLHttpRequest 一樣,Fetch 可用於提出相同的來源要求或跨網域要求。Fetch 會使用更簡潔、更強大的 API,將要求與回應區隔開來,並承諾承諾傳回回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-09 (世界標準時間)。
[null,null,["上次更新時間:2024-08-09 (世界標準時間)。"],[[["Fetch API simplifies fetching remote resources, offering a more streamlined approach than XMLHttpRequest."],["It supports both same-origin and cross-domain requests for versatile resource retrieval."],["Fetch API provides a clear separation between request and response for enhanced code organization."],["It leverages promises for efficient asynchronous handling of responses, improving code readability and performance."]]],["Fetch API simplifies fetching remote resources, handling both same-origin and cross-domain requests. It offers a refined interface compared to XMLHttpRequest, distinguishing the request from the response. Crucially, Fetch utilizes promises to deliver the response, providing a more structured and efficient method for managing asynchronous operations. Its improved design aims to streamline the process of data retrieval from remote sources.\n"]]