It worked, and now it doesn't. Why? *fixed* (thank you!)

It worked, and now it doesn't. Why? *fixed* (thank you!)
0

#1

Hello campers, so a few weeks back I got my Random Quote Generator working, and today I came back to finish it off by getting that pesky Tweet button to work, but when I clicked the New Quote button today, it doesn’t work anymore. I haven’t changed anything so I have no idea which bit is wrong. Can you see anything that looks off? I can’t work on the Tweet button until the quotes are working again. sad panda http://codepen.io/cytronix/pen/PzBzQb


#2

this bit maybe :wink:


#3

What’s wrong with it? I’m not familiar enough with APIs or Ajax to spot mistakes yet :frowning: lol I did check both of the links individually to make sure they both still exist/were correct.


#4

It appears you have two urls placed back to back in one string.


#5

That’s what http://www.crossorigin.me/ tells you to do.


#6

Looks like it’s a problem with https://crossorigin.me

I tried your code with different API and it worked, then tried with crossorigin.me and it didn’t.

I also checked some other projects which use crossorigin.me - all are broken.

Try to implement this API:

P.S. crossorigin.me is a hack you shouldn’t assume that it will always work.


#7

I’ve been struggling with teh same problem all day (https://crossorigin.me)

it’s very unreliable but I can’t find any quote page that doesn’t require it’s use…


#8

So I did a little googling and here are the first five results, that work without crossorigin.me:

https://quotesondesign.com/api-v4-0/ - a little buggy
http://quotes.stormconsultancy.co.uk/api
http://www.icndb.com/api/
http://www.sunnyquotes.net/api/
https://blog.gaborszathmari.me/2015/04/01/sun-tzu-as-a-service-quote-generator/

Codepen with examples:


#9

All fixed :slight_smile: thanks for your help, it was crossorigin that had stopped working and I also needed ‘dataType: jsonp’ not just json. Now to fix the Tweet button!


#10

I’m having the same troubles with crossorigin.me for my weather app :rage:. Guess I’ll have to use (and get used to) $.ajax instead of $.getJSON


#11

i must not be doing something right then. I can’t get any “http//” site to work. JS throws an error about CORS.


#12

i keep getting this error, no matter which http:\ website I pick: