A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/zh-CN/docs/Web/API/XMLHttpRequest/timeout_event below:

timeout - Web API | MDN

MDN Web Docs
  1. 面向开发者的 Web 技术
  2. Web API
  3. XMLHttpRequest
  4. timeout

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

Filter sidebar

在本文中
  1. XMLHttpRequest API
  2. XMLHttpRequest
  3. 构造函数
    1. XMLHttpRequest()
  4. 实例属性
    1. readyState
    2. response
    3. responseText
    4. responseType
    5. responseURL
    6. responseXML
    7. status
    8. statusText
    9. timeout
    10. upload
    11. withCredentials
  5. 实例方法
    1. abort()
    2. getAllResponseHeaders()
    3. getResponseHeader()
    4. open()
    5. overrideMimeType()
    6. send()
    7. setAttributionReporting() 实验性
    8. setRequestHeader()
  6. 事件
    1. abort
    2. error
    3. load
    4. loadend
    5. loadstart
    6. progress
    7. readystatechange
    8. timeout
  7. 继承
    1. XMLHttpRequestEventTarget
    2. EventTarget
  8. XMLHttpRequest API 的相关页面
    1. FormData
    2. ProgressEvent
    3. XMLHttpRequestEventTarget
    4. XMLHttpRequestUpload
  9. 指南
    1. 使用 XMLHttpRequest
    2. XMLHttpRequest 中的 HTML
    3. 同步和异步请求
    4. 发送和接收二进制数据
    5. FormData 对象的使用
在本文中 timeout

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

当进度由于预定时间到期而终止时,会触发 timeout 事件。

冒泡 否 可取消 否 目标对象 XMLHttpRequest 接口 ProgressEvent 示例

js

var client = new XMLHttpRequest();
client.open("GET", "http://www.example.org/example.txt");
client.ontimeout = function (e) {
  console.error("Timeout!!");
};
client.send();
继承

timeout 事件实现了 ProgressEvent 接口,它继承自 Event — 它拥有在这个接口上定义的属性和方法。

规范 Specification XMLHttpRequest
# event-xhr-timeout
XMLHttpRequest
# handler-xhr-ontimeout
浏览器兼容性 参见 Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on 2024年6月6日 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4