What the hell just happened?

So I’ve been flying along with the free code camp curriculum, completing the basic algorithm scripting with no issues. Then I meet the quote generator. HOW IN THE NAME OF GOD DO I EVEN START THIS?

Am I missing something here? I’ve spent around 50 hours on it so far and I’ve gotten nowhere. Surely the few snippets of lessons on JSON and Ajax can’t be it. Where did you guys go to learn more on the subject of APIs etc?

1 Like

Your post just made me laugh out loud. I’m in exactly the same spot. I guess we’ll just have to figure it out. Maybe there are some tips on it in the Guides section of the forums.

Everyone hits this point on one of the projects. Take a deep breath. I’m going to be DRY and link to my response for someone freaking out over the profile project. It all applies to this project too.

2 Likes

I did have to go outside the curriculum to learn more about JSON/Ajax, specifically with working on other APIs. Having said that, you don’t necessarily need to use a quote API for this project. If you want you could just create a static array of your own quotes locally, that’s what I did.

I felt that way too when I got to the Quote Generator…was flying along like butter and then wait, what?! I spent a couple days in panic mode just feeling lost, then I applied Read, Search, Ask… figured it out in Read and Search before getting to the Ask part… but I did a lot of reading and searching.

Take heart, sooo many people have felt that way at this point too and theres a load of information right here in the forums to help with a kick start in the right direction to help consider what steps you need to take and where you need to start the process of thinking to break this down.

I was determined to do mine with API because its something I want to learn…took awhile but when I finally finished, I learned a ton and was happy I stuck with it.

#When you’re finally getting this stuff and the AJAX hits.

1 Like

If you’re using jQuery, choose one of $.ajax() or $.getJSON(), then look through the requisite page in the official jQuery documentation. If you’re using native JS, look up XMLHttpRequest() on MDN.

Also read up on CORS (cross-origin resource sharing). The easiest way to avoid CORS problems is to make sure both the API you’re using and the site hosting your page (likely Codepen) use https (or they both use http, though http is now deprecated based on consensus from security experts).

It’s true you need to read fairly widely outside of fcc, but this is just a skill you’ll need to learn in order to succeed as a developer. It’s just a shame fcc doesn’t explicitly tell students “oh, by the way, you should start researching this stuff now because we haven’t taught it yet.” I think that’s what catches people out and makes them frustrated.

I’m was also in same condition for at least 3 weeks and some how I have managed to get around it. At first, we can try creating our own json file and accessing it with java script then move on to API’s. I used http://wunderground.com/ API which I think is fairly easy. I also helps in satisfying the user stories.

At first I found XMLHttpRequest as easy way to access it. But jQuery is also fairly simple. So try out both methods. To prevent CORS error you can append https://cors-anywhere.herokuapp.com this link to the API request. CORS is explained much detailed manner in https://stackoverflow.com.

2 Likes

Brilliant replies, thanks everyone. Nice to know I’m not completely stupid :blush:

It’s taken me well over a month of hard work to build this Quote Generator and it’s not done yet (looks terrible on a phone). Used native JS for the AJAX. Little piece of advice; going beyond the basic requirements is a pain but worth the effort.

This was very helpful.
I am only on the tribute page part, but I realized that pretty much all I did before the tribute page was copy & pasting and changing the word “blue” to “red”

As a result, everything that I was supposed to learn about bootstrap & jQuery didn’t really stick in my memory and I find myself having to click through all the “lessons” again to remember it.

I guess FCC is good as an introduction to the subjects but really requires external resources to gain a solid understanding of the subjects.

Funny, I had the same problem, but I solved the quote generator with an array of strings and a random index which was than printed out afte an element in the dom using Jquery. But when I arrived at the Local weather apo this took me ages to understand what I was doing.
Key is to understand Json and how to use it. Google , stackoverflow but also Quora, sitepoint and W3 have some good recources on it.

Don’t be afraid to look on youtube or elsewhere and see how other people are doing theirs or just working with API’s in general.

Some times the best approach is to give it a good try, get stuck, try some more, and then realize you’re stuck and go look for answers online. You’ll learn more with this approach than you would have if you just kept banging your head against the wall alone.