Skip to content

Commit

Permalink
Use explicit $.ajax dataType and add error callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan authored and vjeux committed Dec 30, 2013
1 parent c68b972 commit 0ae26fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,12 @@ var CommentBox = React.createClass({
getInitialState: function() {
$.ajax({
url: 'comments.json',
dataType: 'json',
success: function(data) {
this.setState({data: data});
}.bind(this),
error: function(xhr, status, err) {
console.log("comments.json", status, err.toString());
}.bind(this)
});
return {data: []};
Expand Down

0 comments on commit 0ae26fe

Please sign in to comment.