Random quotes-Help need

Hello, there, i tried many forms but I can not display a quote, i have another version where I am dealing with an array of only quotes(without author) and it works fine, but when with an array of object it does not return any quote. The GetQuotes function works fine in a separted js compiler. here is the link

https://codepen.io/ncaxicane/pen/NQKmJa

  1. In your for loop, what is data supposed to be? Did you mean to use the index?
for(let i = 0; i < TSize; i++){
  /* you want i not data */
  EachQuote = Myarrayofquotes[data].quote;
  EachAuthor = Myarrayofquotes[data].author;
}
  1. quote-box is not the element you have queried, did you mean to use quoteBox.

  2. You have a typo in append(), it is EachAuthor not EachAutor.

var quoteBox = $("#quote-box");

quoteBox.slideDown(function() {
  quote-box.html(''); /* quote-box is not the element, quoteBox is */
  quote-box.append('<p id="text">' + EachQuote + '</p>' + '<span id="author">' + '-	' + EachAutor + '</span>'); /* it is EachAuthor not EachAutor */
  quoteBox.slideDown();
}
1 Like

Hey, thanks for the reply, i solved it by using the ctrl+shift+j to seek the error in with the console and the problem was exactly this you mencioned here. Still thanks a lot for the reply.