From bc9a92097e7e7f276303f43d7e4918bf993992ca Mon Sep 17 00:00:00 2001 From: George A Sisco III Date: Wed, 9 Apr 2014 13:42:13 -0400 Subject: [PATCH] Carry ajax error checking from step #13 forward to other ajax steps The following steps also have an ajax function, but the 'error:' param is gone after #13: #14 #17 #19 #20 This may be superfluous, but it helped me find an error with something I was doing - Namely, in my .json file, I had single line javascript comments ("//") that I copied from the tutorial. I couldn't find the issue on later steps, but was able to see my issue when the error handler complained about an unexpected "/" in my file in step #13. --- docs/tutorial.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/tutorial.md b/docs/tutorial.md index 797e9df4b..70b0d254d 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -420,6 +420,9 @@ var CommentBox = React.createClass({ dataType: 'json', success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); }, @@ -526,6 +529,9 @@ var CommentBox = React.createClass({ dataType: 'json', success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); }, @@ -593,6 +599,9 @@ var CommentBox = React.createClass({ dataType: 'json', success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); }, @@ -604,6 +613,9 @@ var CommentBox = React.createClass({ data: comment, success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); }, @@ -641,6 +653,9 @@ var CommentBox = React.createClass({ dataType: 'json', success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); }, @@ -655,6 +670,9 @@ var CommentBox = React.createClass({ data: comment, success: function(data) { this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); }.bind(this) }); },