Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Usability

Web Design Reference Guide

Hosted by

Adding Caffeine to JavaScript

Last updated Oct 17, 2003.

Though some JavaScript snippets require no trimming because they're small to start, JavaScript provides optimization opportunities by using shorter names for variables, functions, and objects.

Take the SSI-like route and save the JavaScript code into a separate file with the .js extension and call for it by putting the following in the <head>:






<script language="JavaScript" type="text/JavaScript" SRC="file.js"><br>
</script>

Taking it out of the page reduces the page's file size and like SSI, it enables you to reuse the code in other pages. This is not all you can do to superpower JavaScript. Check out the resources at the end of the section for advanced techniques.