Need some inspiration!? Check out my awesome random quote machine! Also need some feedback on a small issue

Need some inspiration!? Check out my awesome random quote machine! Also need some feedback on a small issue
0

#1

http://codepen.io/paulSus92/pen/xRONjN

It’s pretty much done, but there is one slight issue I noticed that I’m not quite sure how to resolve. The tweet button only works for the initial quote, but none of the new quotes that come after it. In other words, when you tweet out, say, the fifth quote you’ll get the first quote instead. I’ve looked at the javascript and played around with different things, but nothing seems to fix this issue. If you guys have any ideas I’d appreciate some input.

Other than that I’m pretty pleased with the final result!


#2

Hi, your tweet button is actually working (sort of), but it opens tabs for all the quotes you have clicked through. This is because you add a click event to the tweet button every time you get a new quote. So if you have clicked 5 times on “New Quote” 5 tabs will open (if you browser allows it).

jQuery’s off() will prevent this: $('#tweet').off().click(function() { ... }); This will remove all previously added event handlers.


#3

That did the trick, thanks Ben.