Getting prototype on your site

  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.
  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.
  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.
  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.
  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.
  • : Function split() is deprecated in /nfs/cristina/home1/b/brian/public_html/drupal-6.28/modules/filter/filter.module on line 914.

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 prototypejs.org 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 prototypejs.org
  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:
    [code]

    [/code]

The Google JavaScript API method:

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

    [/code]

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: http://www.prototypejs.org/2008/5/27/prototype-hosted-on-google-s-servers

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