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

Since `load` waits for all iframes and images, you typically don't want JS initialization to be dependent on it.

For non-critical third-party scripts, you might actually want to do something like doc.on('DOMContentLoaded', e => setTimeout(requestIdleCallback(init3rdparties), 2000));




Hi Paul, thanks for sharing the `requestIdleCallback`, I didn't know it, pretty interesting! Though since it's only in Chrome 47+, it will take a while for it to gain market adoption.




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

Search: