CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
JavaScript Jungle
How would you improve this little jQuery Dice Roller?
joshuanhibbert
Permalink to comment
#
March 2012
Trying to teach myself a few things, and am wondering how I could improve this code:
http://jsfiddle.net/joshnh/K5tCE/
Basically I'm after alternate/better ways to code it, and ways to streamline it. Thanks in advance guys!
Also, how do you guys remember what does and doesn't have a semicolon after it?
karlpcrowley
Permalink to comment
#
March 2012
http://jsfiddle.net/K5tCE/27/
I've added comments where I've changed
The , was changed to ; because the variable "value" was being re-declared instead of redefined
Functions don't need to end in ; just lines within the function
joshuanhibbert
Permalink to comment
#
March 2012
Ah, awesome. Good catches Karl. Thanks mate!
karlpcrowley
Permalink to comment
#
March 2012
I was trying to find a font that would change numbers to die faces
but....
wait for it....
... no dice
lol
Add a Comment
Basically I'm after alternate/better ways to code it, and ways to streamline it. Thanks in advance guys!
Also, how do you guys remember what does and doesn't have a semicolon after it?
I've added comments where I've changed
The , was changed to ; because the variable "value" was being re-declared instead of redefined
Functions don't need to end in ; just lines within the function
but....
wait for it....
... no dice
lol