This one is simple enough, and I’d done it before, long, long ago. But I had to look it up that day. Gotta show chemicals in your HTML page? Subscript, ahoy!
Dynamic Table striping
Describes in great detail, how to achieve zebra striping on your tables using jQuery, and even adds a hover-color, which is cool and all, but…
What about when I dynamically load a new part of my page, in response to some user action. And the new part has a table in it. The $(document).ready only runs once. My new table doesn’t have the stripey goodness. Or, if I just reload a table by itself via Ajax? Or just the tbody rows (hello, paging)? How about if I just freaking add a new row (insert_before)?
So, hover color changing. That one is deceptively simple. Instead of .mouseover, you should be doing a .live(‘mouseover’,… That’s what ‘ live’ is for, after all.
Of course, having figured all this out, we started using the jQuery Datatable component, and now it’s all irrelevant. Oh, well. I learned something.
And, last, but not least
Ever needed to generate UUID/GUID’s? http://en.wikipedia.org/wiki/Globally_unique_identifier
Nice little gem
Too bad it doesn’t work with the current version of REE (1.8.7) (ffi incompatible with Ruby version < 1.9 now)
This one works with REE:
Read the whole thread for all the variations people use to do this. Sort of scary, actually.