web/data/cubicweb.ajax.js
changeset 10165 7f1f7f710b16
parent 10164 2094262d6553
child 10215 96085e379066
child 10279 d7479a5ac553
equal deleted inserted replaced
10164:2094262d6553 10165:7f1f7f710b16
    60         return this;
    60         return this;
    61     },
    61     },
    62 
    62 
    63     success: function(result) {
    63     success: function(result) {
    64         this._result = result;
    64         this._result = result;
    65         try {
    65         for (var i = 0; i < this._onSuccess.length; i++) {
    66             for (var i = 0; i < this._onSuccess.length; i++) {
    66             var callback = this._onSuccess[i][0];
    67                 var callback = this._onSuccess[i][0];
    67             var args = [result, this._req];
    68                 var args = [result, this._req];
    68             jQuery.merge(args, this._onSuccess[i][1]);
    69                 jQuery.merge(args, this._onSuccess[i][1]);
    69             callback.apply(null, args);
    70                 callback.apply(null, args);
       
    71             }
       
    72         } catch(error) {
       
    73             this.error(this._req, null, error);
       
    74         }
    70         }
    75     },
    71     },
    76 
    72 
    77     error: function(xhr, status, error) {
    73     error: function(xhr, status, error) {
    78         this._error = error;
    74         this._error = error;