Random Quote Woes

Random Quote Woes
0

#1

I can’t seem to get a new quote to load. I’m trying to use an API because I figured it would be good for me to understand how they work. Can someone please take a look and tell me where I’ve derailed?
Thank you so much


#2

Haiiyo!

If I’m not mistaken you don’t have jQuery enabled for your project at all. Also, I think the API URL is currently wrong (it seems like you may have forgotten to delete another URL that in a code snippet):

https://crossorigin.me/http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?

I could get new quotes after making those changes. Good luck! :slight_smile:


#3

Yeah you definitely need to go into your settings and enable jQuery under the javascript setting.

Also as a side note, you can put the style links you have in the head of your html in the settings as well. You can either put them as is in the header info under the html settings tab, or in the css links.

As for getting another quote, enabling jQuery and taking off the crossoriginme prefix, I do see the call being made in the console. However its giving a MIME error, and I dont know how to fix that.

When I did mine, I ended up using .Ajax() instead of getJSON .

sorry, I cant be of more help.

if you want to take a look at mine let me know ill drop the link, sometimes it can be helpful, sometimes not though, LOL.

  • Nao

#4

I totally forgot about enabling jquery. thanks for that
I also removed the crossorigin.me, but i still cant seem to get it to work.


#5

I would love to see yours. I’ve been looking through other peoples to see if I can decipher their code and figure out what i’m doing wrong.
Thanks


#6

@fullpruf no problem.

I did the same thing trying to figure out how to do the api.

https://codepen.io/Ngoldberg/full/GmJZpX/


#7

@fullpruf you might wanna choose a new API as the forismatic one is no longer supported (which is why your quotes won’t show up). Here’s a link to the thread that alerted me about this. I chose to use that API too until it stopped working, but I’m using the Quotzzy API for my QuoteGen now and it works just fine. :slight_smile: Good luck!


#8

Try using this Random quotes API, it works without issues . You will need to signup for an API key.


#9

Thanks for the help everyone. I finally got it working. My CSS doesn’t seem to be applying to the quote anymore, but that I will deal with later. Appreciate everyone taking their time to assist. :slight_smile: