Need help, random quote machine twitter problem

Need help, random quote machine twitter problem
0

#1

Please help,
When I wont publish post on tweeter it don’t show author instead of that it shows > said by [object HTMLSpanElement]
the code is here https://codepen.io/milangru/full/PmGvXp/


#2

Hi!

You should add variable author before use it. Like you have quote variable. Please try something like that:

  success: function(response) {
    quote = response.quoteText;
    author = response.quoteAuthor;
    $("#quote").text(response.quoteText);
    
    if (response.quoteAuthor) {
      $("#author").text("said by " + author);
    } else {
      $("#author").text("- unkown author");
    }
  }

#3

Thank you, that solve the problem.