From f03d6e212a8ec18c56d26b431e2005ec401efccb Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Sun, 29 Dec 2013 05:29:34 +0000 Subject: [PATCH 1/2] Use explicit $.ajax dataType and add error callback --- docs/docs/tutorial.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docs/tutorial.md b/docs/docs/tutorial.md index d9ca8729cf1..ab49fe57273 100644 --- a/docs/docs/tutorial.md +++ b/docs/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: []}; From 17f14d523becb1823ce471605ad5eea3080320d8 Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Sun, 29 Dec 2013 06:12:45 +0000 Subject: [PATCH 2/2] console.log -> console.error --- docs/docs/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/tutorial.md b/docs/docs/tutorial.md index ab49fe57273..08d2c3660f5 100644 --- a/docs/docs/tutorial.md +++ b/docs/docs/tutorial.md @@ -388,7 +388,7 @@ var CommentBox = React.createClass({ this.setState({data: data}); }.bind(this), error: function(xhr, status, err) { - console.log("comments.json", status, err.toString()); + console.error("comments.json", status, err.toString()); }.bind(this) }); return {data: []};