UPDATE: Enhanced performance of JS on page load