prototype.js just for AJAX

As I stated earlier, the prototype.js library is too large for just using AJAX. In its current version (1.4.0_pre10) it weighs 36KB and contains lots of other features that are most probably not needed when just dealing with AJAX.

I have therefore created a smaller version just for AJAX, based on 1.4.0_pre10: pt.ajax.js 8.9K

It now has only a quarter of size and still provides some nice features such as $ as a wrapper of document.getElementById.

Creating this was not too difficult: it is merely a combination of 4 files that make up prototype.js:

Just do copy and paste into a new files, i.e. copying each file to the bottom of your new javascript file.

As you can see, you can easily create your own customized (smaller!) version of prototype.js to fit your needs.

ajax, prototype.js, customized

8 responses to “prototype.js just for AJAX”

  1. […] Large page sizes are nowadays often caused by large JavaScript libraries. Often you only need a small part of their functionality, so you could use a cut-down version of it. For example when using prototype.js just for Ajax, you could use pt.ajax.js (also see moo.ajax), or the moo.fx as a script.aculo.us replacement. […]

  2. penis enlargement Avatar

    I agree with you the way you view the issue. I remember Jack London once said everything positive has a negative side; everything negative has positive side. It is also interesting to see different viewpoints & learn useful things in the discussion.

  3. Mini Prototype

    The Prototype library is too big just for Ajax (36kb). So Alexander Kirk’s stripped it down precisely that purpose.Don’t know if Scriptaculous will work properly with this, but I’m going bananas with this site if it does!…

  4. dncpax Avatar

    Could you elaborate on how to build a custom lighter prototype lib?

    I can’t find any info on this…

    Thanks,
    dnc

  5. […] Large page sizes are nowadays often caused by large JavaScript libraries. Often you only need a small part of their functionality, so you could use a cut-down version of it. For example when using prototype.js just for Ajax, you could use pt.ajax.js (also see moo.ajax), or the moo.fx as a script.aculo.us replacement. […]

  6. […] Large page sizes are nowadays often caused by large JavaScript libraries. Often you only need a small part of their functionality, so you could use a cut-down version of it. For example when using prototype.js just for Ajax, you could use pt.ajax.js (also see moo.ajax), or the moo.fx as a script.aculo.us replacement. […]

  7. eslam Avatar

    It is very usefull i used it in blogger categories:http://blogger-categories.blogspot.com/

  8. Endre Avatar

    36 kb ? i think it’s more like 100Kb :)

Leave a Reply

Only people in my network can comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post’s permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post’s URL again. (Find out more about Webmentions.)