javascript - Backbone.js : No Network scenario - options.error not triggered -
i have page developed using backbone, handlebar , _.js. while fetching model (as normal http jsonp callback request), set options.error , options.success. success callback gets called properly. however, simulate network down scenario, when disable network adapter in pc (from control panel) , trigger call again, error callback not getting called.
could please suggest if doing wrong?
thanks , best regards, v. vasanth
need @ code find out what's problem. if put callbacks fetch method should right:
model.fetch({ success:function() { }, error:function() { } }); if override model sync method this:
sync:function(method, model, options) { $.ajax({ url:"your_url", // other configs success:function(data) { options.success(data); } error:function() { options.error(); } }) }
Comments
Post a Comment