Browse Source

Use explicit $.ajax dataType and add error callback

main
Ivan Kozik 11 years ago
parent
commit
c72efb80c5
  1. 4
      docs/tutorial.md

4
docs/tutorial.md

@ -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: []};

Loading…
Cancel
Save