facebook/react — pull request #733 by ivan (2013-12-29 05:42:08+00:00)
Title: Use explicit $.ajax dataType and add error callback

Working through the tutorial, I ran into a perplexing problem caused my `.json` file being served as `text/html` instead of `application/json`:

https://ludios.org/tmp/react-json-wrong-mime-type_.png

An explicit `dataType` argument makes the server's incorrect `Content-Type` irrelevant.

After I specified the json dataType, my application silently failed to load comments because my `.json` file had a trailing semicolon. This PR adds an error callback that logs errors to the console. `.toString()` is necessary to print the exception message in Chrome 31 and Firefox 26.