#518 ✓duplicate
Rahul Gupta

Add Ajax.Request#abort

Reported by Rahul Gupta | January 9th, 2009 @ 10:13 AM

I am using request.abort() to stop the ajax call. The code is working fine in IE7 and Mozilla 3.0. While it fails on Chrome, where oncomplete event registered with AjaxResponder is not being called.

Please suggest the possible workaround. Is there any plan to provide abort() method implementation with Ajax.Request???

var AbortRequest = function(request){

this.abort = function(){
    request.options['onSuccess'] = request.options['onFailure'] = Prototype.emptyFunction;
    request.options['insertion'] = Insertion.Top; request.transport.abort();
    if(navigator.userAgent.indexOf('Chrome') !== -1) Ajax.activeRequestCount--; /* Patch to work with google chrome. Need to check with other browsers.*/ 
};

};

Comments and changes to this ticket

  • Tobie Langel

    Tobie Langel January 12th, 2009 @ 02:00 AM

    • Tag set to needs_patch, needs_tests
    • State changed from “new” to “enhancement”
    • Assigned user set to “Tobie Langel”
    • Title changed from “AjaxResponder.register not working after abort” to “Add Ajax.Request#abort”
  • Mark Caudill

    Mark Caudill February 3rd, 2009 @ 03:38 PM

    I'd like to just point to http://prototype.lighthouseapp.c... as it has abort and a lot more that are needed fixes. I never created patches, but that's largely because it's a big rewrite of most of the Ajax component.

  • Tobie Langel

    Tobie Langel July 23rd, 2009 @ 04:26 AM

    • State changed from “enhancement” to “duplicate”

    This issue has already been reported here: #302

    We're closing this ticket as duplicate. Thanks for taking the time to contribute.

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:26 AM

    • Tag changed from needs_patch, needs_tests to missing:tests, needs_patch

    [not-tagged:"needs_tests" tagged:"missing:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:28 AM

    • Tag changed from missing:tests, needs_patch to missing:patch, missing:tests

    [not-tagged:"needs_patch" tagged:"missing:patch" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:36 AM

    • Tag changed from missing:patch, missing:tests to missing:patch, needs:tests

    [not-tagged:"missing:tests" tagged:"needs:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:37 AM

    • Tag changed from missing:patch, needs:tests to needs:patch, needs:tests

    [not-tagged:"missing:patch" tagged:"needs:patch" bulk edit command]

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Pages