About "Build a Random Quote Machine"

About "Build a Random Quote Machine"
0.0 0

#1

Hi,

I have to do the FCC Challenge “Build a Random Quote Machine”.As I was stick witt the jQuery and CSS code, I looked through the code, and I realized I was far from being able to master this type of code.

Is there any other coding solution that is simpler? There are a lot of coding lines just for this random quote machine, and I wonder if there would be a simpler way to code it?

I could do the HTML and CSS part, but the JS and JQuery part are too hard for me right now.


#2

Hi Theoask,

I had alot of trouble with this one due to my lack of knowledge understanding how api calls work. I ended up watching alot of youtube vids and looking at alot of different explanations before I could wrap my head around it. That being said, it can be done with very few lines of code. FCC is about learning JS and jQuery along with HTML and CSS. I would suggest doing some more research and trying again. I found that jQuery was not as hard as I thought once I began to understand the basics.

Take a look at this, it may be helpful:

Good luck,

Atheatics


#3

There is no requirement to use an API to get your quotes. Instead, you can simply create a data-structure (array, object, combination of the two) to hold your quotes and then access/display them via your own method (code).


#4

Hi? I’ve started doing my own pen, but for the Facebook and Twitter buttons, why don’t I see the icon in the buttons please?

And how can I anmimate easily the background color everyt ime I clicj to get a new quote in Javascript? Do I have to use AJAX or JSON necessarily with an onclick event?

My pen: https://codepen.io/theoask/pen/vjMMoR


#5

You just need to add font-awesome in the settings under css if you want those Icons to show up.

you can add to your existing “#quote-button” on click just add the jquery to edit the background color by random RGB or by an array of colors or image sources.


#6

My Quote Generator is not working anymore…Anybody knows why??

https://codepen.io/theoask/pen/vjMMoR


#7

Look at the error message in the javascript window. If you still can’t get it I’ll help further.


#8

I don’t understand what’s wrong…


#9

if you click the red ! in the bottom of your javascript window it gives you the error:

just delete or add that bracket to your commented out section.