I’ve done 2 quote generators, and both “broke” after a few hours. This one I link worked perfectly fine a few hours ago, now I when I try it it just gets one quote and it stops working…Is there any explanation for this? I’m at a loss:
Do you see any errors in your browser’s console?
Hmm no. It only works when I try it at work, where I made it…Does it work for you?
It works for me in firefox, but it’s not working in chrome. It must be some browser related problem, probably cuz of the $.get method.
BTW, I think there should be a quote available when you just load the page, currently you get the first quote after clicking the button.
Try this:
Get rid of crossorigin.me
, change format to jsonp
and add callback &jsonp=?
to the end of your url so it looks like this:
var apiUrl = "http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?";
Change method from .get() to .getJSON():
...
$.getJSON(apiUrl, function(data) {
...
Yes that did it, I’m going to try an understand why now. Thx.