@samitouri / QOS-React-2 / commits / af7ea7c999

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.

George A Sisco III committed Apr 9, 2014 at 13:42 UTC af7ea7c9991c7e8691dac4b3c93e61fb048dd19b
1 file changed +18
docs/docs/tutorial.md
+18
@@ -420,6 +420,9 @@ var CommentBox = React.createClass({
420 dataType: 'json',
421 success: function(data) {
422 this.setState({data: data});
423 + }.bind(this),
424 + error: function(xhr, status, err) {
425 + console.error(this.props.url, status, err.toString());
426 }.bind(this)
427 });
428 },
@@ -526,6 +529,9 @@ var CommentBox = React.createClass({
529 dataType: 'json',
530 success: function(data) {
531 this.setState({data: data});
532 + }.bind(this),
533 + error: function(xhr, status, err) {
534 + console.error(this.props.url, status, err.toString());
535 }.bind(this)
536 });
537 },
@@ -593,6 +599,9 @@ var CommentBox = React.createClass({
599 dataType: 'json',
600 success: function(data) {
601 this.setState({data: data});
602 + }.bind(this),
603 + error: function(xhr, status, err) {
604 + console.error(this.props.url, status, err.toString());
605 }.bind(this)
606 });
607 },
@@ -604,6 +613,9 @@ var CommentBox = React.createClass({
613 data: comment,
614 success: function(data) {
615 this.setState({data: data});
616 + }.bind(this),
617 + error: function(xhr, status, err) {
618 + console.error(this.props.url, status, err.toString());
619 }.bind(this)
620 });
621 },
@@ -641,6 +653,9 @@ var CommentBox = React.createClass({
653 dataType: 'json',
654 success: function(data) {
655 this.setState({data: data});
656 + }.bind(this),
657 + error: function(xhr, status, err) {
658 + console.error(this.props.url, status, err.toString());
659 }.bind(this)
660 });
661 },
@@ -655,6 +670,9 @@ var CommentBox = React.createClass({
670 data: comment,
671 success: function(data) {
672 this.setState({data: data});
673 + }.bind(this),
674 + error: function(xhr, status, err) {
675 + console.error(this.props.url, status, err.toString());
676 }.bind(this)
677 });
678 },