Home > Web Front-end > JS Tutorial > How to use jquery ajax abort()_jquery

How to use jquery ajax abort()_jquery

WBOY
Release: 2016-05-16 18:17:38
Original
1471 people have browsed it

Since I am using jquery, I couldn’t find the .abort() method in the manual. I searched online and saw about the .abort() method in jquery at http://ooxx.me/jquery-ajax-abort.orz. ) Usage method, use the example directly:

Copy code The code is as follows:

current_request = $. get('/events', { 'Qixi': '发春' },function(resp) { alert(resp); });
if(current_request) {current_request.abort();}


But when you use this current_request.abort(); method to cancel, the $.ajax success event will actually be triggered, so the callback function in success needs to be added to determine whether current_request exists, and the callback will be executed only if it exists. Function
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template