การดึงข้อมูลเป็น API ใหม่ที่ทําให้ "การดึงข้อมูล" ทรัพยากรระยะไกลได้ง่ายขึ้น คุณใช้ Googlebot เพื่อส่งคําขอต้นทางหรือคําขอโดเมนเดียวกันได้เช่นเดียวกับ XMLHttpRequest การดึงข้อมูลใช้ API ที่ชัดเจนและมีประสิทธิภาพมากกว่า ซึ่งจะแยกคําขอออกจากการตอบกลับ และใช้คํามั่นสัญญาว่าจะตอบกลับ
ข้อมูลเบื้องต้นเกี่ยวกับ Fetch API
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],["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"],null,[]]