How do I get Google Closure to call my init function when DOM tree finished
I am looking for something like the $(document).ready
function in jQuery, as I work on experimenting with using Closure.
So, my question is simple, is there a function I am missing that will allow me to wait until my function is called when the DOM tree is done?
I use unobtrusive javascript, so the idea of putting any javascript in my html is such a ne开发者_StackOverflow中文版gative, if that is required.
Looks like you're out of luck according to this. Inline script blocks appears to be your only choice.
If you want to do it your way (instead of Google's way), perhaps this would work for you.
Cross Browser JavaScript DOMContentLoaded
精彩评论