How to use static variables in a Javascript function

There may be times when a static variable is needed in a Javascript function; static variables maintain their value between function calls and are tidier than using a global variable because they cannot be modified outside of the function.

Calling $(document).ready multiple times with jQuery

jQuery’s $(document).ready() function runs the code within that function after the DOM is loaded (I’ve written about this previously here). Something I haven’t needed to do before, but was wondering if it’s possible, is to use $(document).ready() more than once.