BackboneJS save calling error handler on success
If you call save on a Backbone model and receive a 200 OK response, but the error handler is still being called, look at the response body.
If the body is not valid JSON (ex. the body is "") then the error handler will still be called even though the status is a success.
Either replace the save call with a regular $.ajax or return valid JSON (ex. "{}").
Written by robertjlooby
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Backbone
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#