So I had done this challenge last year using a array and just pulling from it. But now that I’m coming back to coding and planning on pursuing it I feel like I really need to challenge myself and really create a good portfolio.
So I am working on the Random Quote generator and I am trying to use the Quotes on Design API. and I am completely stuck. I have no idea how to get it to work. I have ready the documentation from Quotes on Design, but still…
I haven’t gotten to the “Ransom Quote” generator yet, but I would suggest using letters cut out from magazines.
But seriously, when I run your code and look in the console, I see that that web site is timing out. I can’t even get the site to load up in my browser. I don’t know if it is down temporarily or if there are bigger issues. I might try a different site for now.
Looks like quotesondesign.com is down. You also have an error in the onclick event handler, it should be on(‘click’, and not on(click, (you forgot the quotes)
I played around a bit more and i’ve finally gotten the api to work and to display the quote and author in the div’s i wanted them in, so thanks you were a tremendous help!
There are ways to get a quote from a specific genre, if the API you are making the call to allows it. Most of these APIs do provide the service (sometimes free, sometimes for a monthly fee), you will have to go through the documentation to find out. What API are you using to display the data?
Some APIs will send the response over HTTPS and other wont. I believe Codepen only allows API calls over HTTPS, the error you included is basically saying that, so I would assume this is true. There are some workarounds, but there are also APIs that serve over HTTPS, like Quotes on Design, if I’m not mistaken.
You can use Postman to send requests and see what kind of response you get, without the need to run the code and look at the response in a browser window. Hope this helps!
EDIT
Quotes on Design API might be over HTTP also, now that I think about it …
BobbyB, i had some issues when i first tried to repair my script to match ksjazzguitar, if you include your codepen link I could take a look, if you wanted and you were still having issues?