I think it would be best to find an alternative to Forismatic for this challenge. Because of the nature of cross-origin requests, the default JSON API will not work. While Forismatic does appear to offer a JSONP API, the response doesn't come back in JSON(P) format, but rather as text/html (and in russian...). It appears they are still testing JSONP, and shouldn't be considered a reliable resource for fetching quotes.
The API Endpoint at http://api.icndb.com/jokes/random on the other hand, gracefully handles JSONP requests and would be a better stand-in.
Errrrr... @patrickjtoy You should read more carefully things, because Forismatic is an excelent alternative for this.
And it offers a JSONP API and, of course, in JSON format and in english. I know that because, like much other campers, I used that library without zero problems for my zipline :).
@soulchainer I had spent several hours trying to get Forismatic to work before finally giving up, going with the jokes API, and filing this bug. Having taken some time and returning to the problem, I've discovered a solution while looking at the network tab of the developer tools on the http://api.forismatic.com/api/jsonp/ example page.
For anyone else having issues, the required format to make a JSONP request of Forismatic is http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp= [callback function or "?" if using jQuery]
It would have been much easier if the above was given as the example for JSONP on the Forismatic site!
Most helpful comment
@soulchainer I had spent several hours trying to get Forismatic to work before finally giving up, going with the jokes API, and filing this bug. Having taken some time and returning to the problem, I've discovered a solution while looking at the network tab of the developer tools on the http://api.forismatic.com/api/jsonp/ example page.
For anyone else having issues, the required format to make a JSONP request of Forismatic is http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp= [callback function or "?" if using jQuery]
It would have been much easier if the above was given as the example for JSONP on the Forismatic site!