prototype.js just for AJAX
Wednesday, October 5th, 2005 at 12:07 +0000 (UTC) by Alexander KirkAs 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:
- HEADER (needs modification from the original prototype.js)
- prototype.js (without includes)
- base.js
- 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.
October 16th, 2005 at 11:50 +0000 (UTC)
10x this is a great ideea and for me that i'm a beginer at java is great. keep up the good work
February 2nd, 2006 at 12:04 +0000 (UTC)
[...] 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. [...]
February 9th, 2006 at 20:15 +0000 (UTC)
This is great. You also mention Sack of ajax. Which one do you typically use?
Also, you reference $R in base.js - so you may want to add that definition back.
[also, I really liked your 10 Realistic steps ...]
--K
March 14th, 2006 at 15:04 +0000 (UTC)
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.
March 30th, 2006 at 00:17 +0000 (UTC)
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!...
April 8th, 2006 at 19:13 +0000 (UTC)
Could you elaborate on how to build a custom lighter prototype lib?
I can't find any info on this...
Thanks,
dnc
April 19th, 2006 at 16:15 +0000 (UTC)
[...] 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. [...]
May 27th, 2006 at 14:47 +0000 (UTC)
[...] 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. [...]
August 1st, 2006 at 19:01 +0000 (UTC)
It is very usefull i used it in blogger categories:http://blogger-categories.blogspot.com/
January 31st, 2007 at 07:49 +0000 (UTC)
prototype is too hevey on the server so how we customize according to our requirement.
June 18th, 2007 at 17:07 +0000 (UTC)
36 kb ? i think it's more like 100Kb :)