Skip to content

Commit

Permalink
A bit more documentation on success and error callbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Nov 5, 2012
1 parent 29cb71c commit 35054da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,8 @@ <h2 id="Model">Backbone.Model</h2>
latest server state. A <tt>"change"</tt> event will be triggered if the
server's state differs from the current attributes. Accepts
<tt>success</tt> and <tt>error</tt> callbacks in the options hash, which
are passed <tt>(collection, response, options)</tt>
and <tt>(collection, xhr, options)</tt> as arguments, respectively.
are passed <tt>(model, response, options)</tt>
and <tt>(model, xhr, options)</tt> as arguments, respectively.
</p>

<pre>
Expand Down Expand Up @@ -1139,7 +1139,8 @@ <h2 id="Model">Backbone.Model</h2>

<p>
<b>save</b> accepts <tt>success</tt> and <tt>error</tt> callbacks in the
options hash, which are passed <tt>(model, response)</tt> as arguments.
options hash, which are passed <tt>(model, response, options)</tt> and
<tt>(model, xhr, options)</tt> as arguments, respectively.
The <tt>error</tt> callback will also be invoked if the model has a
<tt>validate</tt> method, and validation fails. If a server-side
validation fails, return a non-<tt>200</tt> HTTP response code, along with
Expand All @@ -1157,7 +1158,9 @@ <h2 id="Model">Backbone.Model</h2>
request to <a href="#Sync">Backbone.sync</a>. Returns a
<a href="http://api.jquery.com/jQuery.ajax/#jqXHR">jqXHR</a> object, or
<tt>false</tt> if the model <a href="#Model-isNew">isNew</a>. Accepts
<tt>success</tt> and <tt>error</tt> callbacks in the options hash.
<tt>success</tt> and <tt>error</tt> callbacks in the options hash, which
are passed <tt>(model, response, options)</tt> and <tt>(model, xhr, options)</tt>
as arguments, respectively.
Triggers a <tt>"destroy"</tt> event on the model, which will bubble up
through any collections that contain it, and a <tt>"sync"</tt> event, after
the server has successfully acknowledged the model's deletion. Pass
Expand Down

0 comments on commit 35054da

Please sign in to comment.