Getting prototype on your site

In order to use prototype you first have to include the JavaScript into your web page/s. There are a couple different ways to do this: A) Download the code from and install the script on your server... then reference the script on your page. Or B) use Google's JavaScript API and let them handle the hard stuff.

I'll cover both but tend to lean towards the Google method as it requires less work to get started and it's incredibly easy to upgrade to future versions.

Download the code yourself (a bit more work but more control over the code):

  1. Download the prototype script from
  2. Upload the script to your server in an easy to reference sub-directory like "js" or "includes/js"
  3. Reference the script within the HEAD section of your web page using code like the following:


The Google JavaScript API method:

  1. Put the following code within the HEAD section of your web page/s:


Whichever method you go with, the added JavaScript will moderately increase the amount of data your audience has to download to view your site. How much overhead is added depends on whether you're using a compressed version of the script or not. This is another good reason to use Google's JSAPI, it will be cached for one year and served with the proper compression headers. That means that most users will incur a ~30 KB download only once.

For even more information, see:

Now let's move on to using Prototype's Ajax objects...