100-javascript-projects icon indicating copy to clipboard operation
100-javascript-projects copied to clipboard

Slight tweak

Open kingkool68 opened this issue 10 years ago • 0 comments

You don'y need the getQuote() function since it can be reduced to one line and you only use it once. Good thinking on cahcing the jQuery selector by storing the next button as it's own variable but if you don't use that cached selector again then it doesn't really matter.

Another fun technique is to bind an event to an element and then you want to trigger that event so you could write $('.next').on('click', randomize).trigger('click') which tells jQuery to basically simulate a click on the next button triggering your randomize() function.

kingkool68 avatar Oct 27 '15 15:10 kingkool68