中止AJAX请求(dojo) [英] Abort the AJAX Request (dojo)

查看:72
本文介绍了中止AJAX请求(dojo)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在使用dojo.xhrPost发送ajax请求。我想知道是否有一种方法可以在该请求之前执行另一个javascipt事件完成后,我可以中止该请求。

我如何中止请求?在此先感谢...

Hi All,

I am using dojo.xhrPost to send an ajax request.I would like to know if there is a way that when another javascipt event is executed before that request was finished, can I abort that request.
How can i abort the request? Thanks in Advance...

推荐答案

为什么要中止ajax请求?


然而,你只需要第二个javascript调用的第二个条件(除了request.status == 200)。
why do you want to abort the ajax request?

nevertheless, you only need a second condition (besides request.status == 200) that the second javascript invokes.


我认为你不能中止ajax请求。您可以忽略处理ajax响应。例如:

I don''t think you can abort ajax request. You can ignore handle the ajax response. for example:

展开 | 选择 | Wrap | 行号


如果您对请求对象有引用,那么您可以使用它的中止( )-method ...看看它这里


亲切的问候
in case you have a reference to the requestobject then you may use its abort()-method ... have a look at it here

kind regards


这篇关于中止AJAX请求(dojo)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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