Friday, August 25th, 2006
DOMContentLoaded Gains Traction; Now in Dojo
The startup time of Dojo has improved, and it it due to DOMContentLoaded now being the onload event.
This last weekend I finally implemented Dean Edwards’ DOMContentLoaded (with Matthias Miller and John Resig) solution for the dojo.addOnLoad event, as opposed to using the window.onload event to fire all initialization…and so far (with the exception of some minor side effects, notably with widgets that use images for layout) it is working very well–and the bottleneck of initial load performance (you know, where the page seems to take forever to load) has been markedly improved.
It’s almost like night and day, in some respects.












This feature is also included in the Unobtrusive JavaScript plugin for Rails that you blogged about earlier in the week. JQuery also uses this technique.
wohoow, taken from jQuery :)