Help with my Random quote machine generater

Help with my Random quote machine generater
0.0 0

#1

Hi guys,
I am working on my random quote and when I click on the bottom to get a new quote it is not displaying my test quotes. I know the problem is in my JS but I can’t figure out what it is, and also my headings and quote box do not seem to be centered even though when I run the local files on my computer from my text editor and web browser they are.Can someone please help?


Thank you,


#2

I am going to guide you through how to fix your syntax and logic errors by asking you some questions:

#1 and #2) You have the following line:

$('#quote').text(response.quoteText);

What do you think the value of response.quoteText is and why? The same question for response.quoteAuthor in the following line:

if (response.quoteAuthor) {

#3) You call a function called getNewQuote twice in your solution with getNewQuote(); I do not see where you ever declare and define a function getNewQuote. What do you expect to happen when calling this function?

Answering these 3 questions will help clarify what you think is going on in your code, so that I can steer you in the right direction.


#3

Thank you for your help, you help what I was doing wrong.