Skip to content

Commit

Permalink
augmenting the docs for Model#toJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Oct 13, 2010
1 parent c0f602e commit cd0d2cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,13 @@ <h2 id="Model">Backbone.Model</h2>
</p>

<p id="Model-toJSON">
<b class="header">toJSON</b><code>model.toJSON</code>
<b class="header">toJSON</b><code>model.toJSON()</code>
<br />
Return a copy of the model's <a href="#Model-attributes">attributes</a> for JSON stringification.
This can be used for persistence, serialization, or for augmentation before
being handed off to a view.
being handed off to a view. The name of this method is a bit confusing, as
it doesn't actually return a JSON string &mdash; but I'm afraid that it's
the way that the <a href="https://developer.mozilla.org/en/JSON#toJSON()_method">JavaScript API for <b>JSON.stringify</b> works</a>.
</p>

<pre class="runnable">
Expand Down

0 comments on commit cd0d2cc

Please sign in to comment.