Review this JavaScript function that loads several independent resources for a page. It's slower than expected.