- Avoid abusing document ready.
- Keep the document ready for initialize code only.
- Always extract functions outside of the doc ready so they can be reused.
I have seen hundreds of lines of code inside the doc ready statement. Ugly, unreadable and impossible to maintain.