[removed] How to stop multiple jQuery ajax error handlers?

前端 未结 2 1810
甜味超标
甜味超标 2021-01-04 09:55

A team member put this into our project

$(function() {
    $(\"body\").bind(\"ajaxError\", function(event, XMLHttpRequest, ajaxOptions, thrownError){
                


        
2条回答
  •  孤城傲影
    2021-01-04 10:50

    Global events can be disabled, for a particular Ajax request, by passing in the global option, like so:

     $.ajax({
       url: "test.html",
       global: false,
       // ...
     });
    

    Taken from: http://docs.jquery.com/Ajax_Events

提交回复
热议问题