我如何判断和QUOT;中止()"被称为上XMLHTT prequest [英] How can I tell if "abort()" has been called on an XMLHTTPRequest

查看:155
本文介绍了我如何判断和QUOT;中止()"被称为上XMLHTT prequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题,但是从Mozilla的JS文档并不明显。任何人都知道了他们的头顶部的答案?

Simple question, but not obvious from the Mozilla JS docs. Anyone know the answer off the top of their head?

推荐答案

下面是标准的执行情况。基于以下,唯一的办法是检查对象的readyState,但不会在所有浏览器。

Here's the standard implementation. Based on below, the only way is to check the readyState of the object, however this won't work in all browsers.

语法

XMLHtt prequest.abort()返回值

XMLHttpRequest.abort() Return Value

没有返回值。

备注

中止是在Windows介绍   Internet Explorer 7中。

abort was introduced in Windows Internet Explorer 7.

Abort方法中断的   正在进行中的异步操作。   (传真到了varAsync参数   打开创建异步   请求。)

The abort method interrupts an asynchronous operation in progress. (Pass true to the varAsync parameter of open to create an asynchronous request.)

调用中止重置对象;该   onreadystatechange事件处理程序   除去,并且readyState的变更为   0(未初始化)。

Calling abort resets the object; the onreadystatechange event handler is removed, and readyState is changed to 0 (uninitialized).

来源

这篇关于我如何判断和QUOT;中止()"被称为上XMLHTT prequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆