Hacker News new | past | comments | ask | show | jobs | submit login

LABjs is a useful JavaScript library that lets you load JavaScript on-demand and specify dependencies: http://labjs.com/



LABjs is great for making javascript not block the rendering of your page. It's not just a simple switch though. Depending on how your code is structured, and the various assumptions you've made there may need to be some code changes. The biggest thing, is that if you load everything in LABjs - including jQuery - then the document.ready event fires BEFORE ALL THE JAVASCRIPT IS LOADED/EXECUTED. This is incredibly important because many many people code with $(document).ready being the signal to run all sorts of stuff. However, with LABjs the meaning of document.ready changes so you can't assume that things like plugins have been declared when document.ready fires.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: