- Saturday, 24th Oct, 2015
It’s about 35% faster than the previous! The domContentLoaded event fires shortly after the HTML file is parsed & the jQuery core library is loaded. As we can see the blue vertical line from the waterfall, the parser doesn’t need to wait for the rest of the external scripts loaded. Sounds great right? But, why we didn’t add async attribute to jQuery core library for this case? Well.. the main reason is asynchronous scripts are not guaranteed to execute in specified order and should not use document.write. Scripts that depend on execution order, due to these issue we should make sure that jQuery core library is loaded prior to any jQuery dependent plugins.