Quote machines breaking up

Quote machines breaking up
0.0 0

#1

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:

http://codepen.io/Hyde87/pen/pEjaOV


#2

Do you see any errors in your browser’s console?


#3

Hmm no. It only works when I try it at work, where I made it…Does it work for you?


#4

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.


#5

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) {
...

#6

Yes that did it, I’m going to try an understand why now. Thx.