Here’s an example:
Even better, use XSSI to merge your script directly into your page, to avoid an extra HTTP request, like this:
Note that any functions defined in these delayed files will not be available until the page has loaded. For validation and overlaid menus, this shouldn't be a problem. Note also, that any scripts referenced outside of the head of your XHTML documents cannot be reliably compressed by modern browsers. We'll cover HTTP compression in a future tweak.
- Chapter 9 of Speed Up Your Site shows this and other time-saving techniques to speed up your scripts and reduce their footprint.