Browse Source

Merge pull request #733 from ivan/master

Use explicit $.ajax dataType and add error callback
main
Pete Hunt 11 years ago
parent
commit
d24fbf6d7b
  1. 4
      docs/tutorial.md

4
docs/tutorial.md

@ -384,8 +384,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.error("comments.json", status, err.toString());
}.bind(this)
});
return {data: []};

Loading…
Cancel
Save