Title: prototype.js just for AJAX
Author: Alex Kirk
Published: October 5, 2005
Last modified: August 23, 2007

---

# prototype.js just for AJAX

October 5, 2005

As I stated earlier, the [prototype.js](http://www.prototypejs.org/) 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](https://alex.kirk.at/area7/2005/10/05/pt.ajax.js?output_format=md) 
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:

 * [HEADER](http://dev.conio.net/repos/prototype/src/HEADER) (needs modification
   from the original [prototype.js](http://dev.conio.net/repos/prototype/dist/prototype.js))
 * [prototype.js](http://dev.conio.net/repos/prototype/src/prototype.js) (without
   includes)
 * [base.js](http://dev.conio.net/repos/prototype/src/base.js)
 * [ajax.js](http://dev.conio.net/repos/prototype/src/ajax.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

[Ajax](https://alex.kirk.at/category/code/ajax/), [Code](https://alex.kirk.at/category/code/)

Read this next

[Rise of slow AJAX applications](https://alex.kirk.at/2005/10/04/rise-of-slow-ajax-applications/)

## 8 responses to “prototype.js just for AJAX”

 1.  [alexander kirk » Blog Archive » 10 Realistic Steps to a Faster Web Site](http://alex.kirk.at/2006/02/02/10-steps-to-a-faster-web-site/)
 2.  [February 2, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-135)
 3.  […] 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.[…]
 4.  [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 5.  ![penis enlargement Avatar](https://secure.gravatar.com/avatar/6a7c8e35dc26fbbc7c7ff9040123ae27ba3ccdbef6f44a472cd665e57a793036?
     s=48&d=mm&r=g)
 6.  [penis enlargement](http://www.oksextoys.com)
 7.  [March 14, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-259)
 8.  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.
 9.  [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 10. [a free Orange | Links](http://links.freeorange.net/archives/200603/291710)
 11. [March 30, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-409)
 12. **Mini Prototype**
 13. 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!…
 14. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 15. ![dncpax Avatar](https://secure.gravatar.com/avatar/12fe5c49b3f3bf1fc09eb7553257cacba67387a8cfea740a4e7a73918920b16e?
     s=48&d=mm&r=g)
 16. [dncpax](http://-)
 17. [April 8, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-525)
 18. Could you elaborate on how to build a custom lighter prototype lib?
 19. I can’t find any info on this…
 20. Thanks,
      dnc
 21. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 22. [Airabove | Online portfolio of swedish web designer and graphical artist Robert Arnesson](http://www.airabove.com/index.php/67)
 23. [April 19, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-597)
 24. […] 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.[…]
 25. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 26. [XOOPS CHINA – WordPress » 10 Realistic Steps to a Faster Web Site](http://xoops.org.cn/modules/wordpress/?p=276)
 27. [May 27, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-1720)
 28. […] 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.[…]
 29. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 30. ![eslam Avatar](https://secure.gravatar.com/avatar/18d2f2d68c5d2bc452f119a5ad483448a574899318c8ff201d5db6aae71e5616?
     s=48&d=mm&r=g)
 31. [eslam](http://emorshdy.blogspot.com/)
 32. [August 1, 2006](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-4114)
 33. It is very usefull i used it in blogger categories:[http://blogger-categories.blogspot.com/](http://blogger-categories.blogspot.com/)
 34. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)
 35. ![Endre Avatar](https://secure.gravatar.com/avatar/ce8e853486bb872bb668e0cf47dc37d246530e77cf03a5febf35669da5503810?
     s=48&d=mm&r=g)
 36. [Endre](http://eweb.ws)
 37. [June 18, 2007](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/#comment-67496)
 38. 36 kb ? i think it’s more like 100Kb :)
 39. [Log in to Reply](https://alex.kirk.at/wp-login.php?redirect_to=https%3A%2F%2Falex.kirk.at%2F2005%2F10%2F05%2Fprototypejs-just-for-ajax%2F)

### Leave a Reply 󠀁[Cancel reply](https://alex.kirk.at/2005/10/05/prototypejs-just-for-ajax/comment-page-1/?output_format=md#respond)󠁿

Only people in [my network](https://alex.kirk.at/friends/) can comment.

This site uses Akismet to reduce spam. [Learn how your comment data is processed.](https://akismet.com/privacy/)