Random quote gen - feedback welcome

I’m really bad with styling like a lot of us newer people studying here. I finished my quote generator today and am looking for some feedback. Anything about the functionality, styling, etc… I really want to get better and I’m not quite satisfied with this project but I’m really not sure what else to do.

Here’s the link:

All thoughts welcome. You’re probably not going to hurt my feelings!

Why not figure out a way for a quote to be loaded when the page first loads? You already have a function which loads a quote. Give it a name and move it outside the click event handler and then use it as the callback function for the click event handler and also call the function at the bottom of your code (within the document.ready callback function).

BTW - Your tweet button does not work.

1 Like

Thank you! I’ll look into auto generating a quote. I thought about having that at the start but also wanted to tell the user the button was below for additional quotes.

That’s weird that the tweet button isn’t working for you. I know that it shows ‘undefined undefined’ when a quote hasn’t been generated yet, but it is pulling the quote/author once you generate one for me. Is that not working the same for you?

If you click on the tweet button in the Codepen after you have clicked to get a quote, then it will not work, because Codepen does not allow directly links. I am using Chrome, but I just realized you were using debug mode vs. full mode (what I was testing in), so that is probably the difference. It appears debug mode does not use an iframe like the full and editor modes do, so it works.

Thanks for the feedback :slight_smile: I’m going to work on moving the generateQuote function outside of the current scope and generate a quote upon page load.

Should I read into iframe to make the tweet work with full mode as well or would that be an unnecessary step?

The debug mode works more like the page would if you hosted on your own server or github, but if you plan to use the full mode version on Codepen, you will have to add a target="_blank" inside the anchor element to get a new window to pop up.