Need help with javascript quote generator

Hi, Thanks in advance for the help! When my tweet btn in the quote generator is clicked its response is undefined instead of giving me the quote. Can someone take a look at my code?

When I inspect it I get
VM1137 bootstrap.min.js:7 Uncaught Error: Bootstrap tooltips require Tether (http://tether.io/)
This is over my head…and I’m not even sure that is really the problem.

Hi Barb1643

Your tweet button is working, the problem is your randomQuote variable. Actually its value is undefined which is quite normal as you haven’t assigned it any value in your code. Simple to check your code, assign any arbitrary value to your randomQuote variable, run and tweet using your button. You will see it works. Now just manage to get your quote into your randomQuote variable.

I gave it a value of var randomQuote = quote and it returned [object Object],[object Object],[object Object] when i clicked the tweet button. So I don’t understand…

Can someone please help me with this today? The last reply didn’t help, I have spent hours trying to get it to work. Bout ready to give up…

Hi, Thanks in advance for the help! When my tweet btn in the quote generator is clicked its response is undefined instead of giving me the quote. Can someone take a look at my code? What am I missing? When I define var randomQuote it doesn’t do anything.

Hi it looks everything is ok now? Still my first reply unuseful? Glad you got it, there are two ways to get around this either you store the value as you did or you get the value of quote component (node) at moment you want to tweet !

For some reason that didn’t work. When I defined it at the top of the function nothing worked at all. Then I found a fix on the code 360 you tube comment. I don’t really know what I am doing yet but I had to define the variables inside the function but I also learned a new way to define a var. But thank you anyway @KKOL !

@KKOL But I do have one other issue, the buttons won’t line up no matter what I do with my CSS. Any idea why? Maybe because I copy and pasted the .btn to the .tweet?

Hi have you touched your HTML or CSS in meanwhile ? I am asking because, It is the first time i found your buttons not on the same line. And I didn’t have a look at your CSS and HTML before.
Anyway, you have a very wide choice to line up both buttons:
1- you can use bootstrap as here https://www.freecodecamp.com/challenges/line-up-form-elements-responsively-with-bootstrap on FCC,
2- you can change the button property display to inline and adjust your css,
3- another way simple you can use table element and just put your button in cells
and probably more options … It is up to you. I am not expert to discuss which way is the best, but just listing what you can use for the job!

**Zut you have modified something in your code HTML and JS, now nothing is working hope you have saved the first version somewhere, anyway it is not big deal **

Just one remark in your HTML when usign bootstrap the structure should be like this
`

<div class="col-md-**> </div> </div>` I mean the element with class col-**-** should be the child of div class row parent

@kkol thank you! oh i forgot the row! I ended up stacking them buttons because nothing was working, now I know why Right now I am trying to do an if statement to remove the hyphen when there is no author.

Your are welcome :slight_smile: