开发者

If an error happens will ajax stop still run?

开发者 https://www.devze.com 2023-01-05 23:59 出处:网络
I am wondering if you do an AJAX request and you have a method that should run when the AJAX request stops.Will the jQuery ajax stop run if the request runs into an error (such as a 500 error) 开发者_

I am wondering if you do an AJAX request and you have a method that should run when the AJAX request stops. Will the jQuery ajax stop run if the request runs into an error (such as a 500 error) 开发者_运维百科or if say the request times out?


Yes, the ajaxStop() event will execute when this happens :)

It happens in the global complete handler, which executes error or not.

You can test it out a bit here.

0

精彩评论

暂无评论...
验证码 换一张
取 消