0

I am executing the following ajax call. I am testing timeout mechanism and thus suspending my server on purpose. The problem is that although I do receive timeout in the client after one second the call as I see it in firebug still continues.

I guess there should some way to stop the call execution but I did not find one.

            $.ajax({
                url: url,
                dataType: "jsonp",
                jsonp: "jsoncallback",
                timeout: 1000,
                success: (function(w) {
                    ...
                    },
                error: function(XHR, textStatus, errorThrown) {
                    alert("Error");
                }
            });

Appreciate the help.

anyab
  • 359
  • 5
  • 11
  • 1
    Possible duplicate of [Abort Ajax requests using jQuery](http://stackoverflow.com/questions/446594/abort-ajax-requests-using-jquery) – NullPoiиteя Nov 17 '15 at 11:02

2 Answers2

0

You can try this

...    
error: function() {
    window.stop()
}
...
Mikayel Margaryan
  • 764
  • 1
  • 7
  • 16
-1

Try this Abort Ajax requests using jQuery

Community
  • 1
  • 1
AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • I saw this post and tried this but it did not terminate the execution of the call and the process of xhr continued. – anyab Jul 12 '11 at 14:40