If I use the $(document).ready() handler from within a function, will it still guarantee that the code inside it will only be run if the document is ready, even
$(document).ready()
Yes. You can put it inside a function, and it'll fire whenever you call that function.