Title: Page 130 – Alex Kirk

---

 * 
   ## 󠀁[prototype.js just for AJAX](https://alex.kirk.at/2005/10/05/prototypejs-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&term_id=44043)
   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/)
 * 
   ## 󠀁[Rise of slow AJAX applications](https://alex.kirk.at/2005/10/04/rise-of-slow-ajax-applications/)󠁿
   
 * October 4, 2005
 * The current movement towards AJAX is a good thing. If it really were a movement
   towards AJAX. In my eyes it is rather a higher acceptance for Javascript applications.
   Of course, it is quite naturally in the early stages of a “hyped” technology 
   to observe many misuses; they use AJAX just for the sake of using _AJAX_.
 * Pages get more voluminous because so much code has to be loaded to the browser(
   which makes the browser slow again) so you could just begin to use the application.
   This somehow reminds me of all the flash apps. Waiting for hours to load the 
   page and you’ll stick to that page for half a minute. (I do have a broadband 
   connection. Still a page with 30kb loads 10 times faster than a 300kb page).
 * A negative example for this is [Kiko](http://www.kiko.com/), a web calendar. 
   It has a nice “Kiko loading” box which already hints that they are doing something
   wrong. All Javascript files are included via server side scripting instead of
   loading them via <script src=”xyz.js”> which would allow the browser to cache
   the file.
 * Kiko is just one example, there are others doing similar mistakes.
 * I think that the current usage of AJAX is a misuse of the browser. They are designed
   to render web pages (i.e. (X)HTML pages). Javascript is a bonus. Large data strucures
   can slow down browsers enourmously (they are still **interpreting** Javascript
   just in time).
 * As a conclusion I want to come up with some essential features for AJAX applications:
    - **Keep it bookmarkable.** Don’t load everything to one page, let users return
      to a certain section of your app via their bookmarks.
    - **Don’t overuse AJAX.** Often simple Javascript without server interaction
      will do. Try to reduce the server callbacks.
    - **Minimize the code to be loaded.** When you don’t have any other choice, 
      consider code downloading.
    - **Speed up your apps with AJAX.** Use AJAX for what it was meant for: tune
      your existing application at points where postbacks need to reload the same
      page with only little change.
 * ajax, kiko, bookmark, code downloading, speed
 * [Ajax](https://alex.kirk.at/category/code/ajax/)

 [Previous Page](https://alex.kirk.at/page/129/?output_format=md&term_id=44043) 
[Next Page](https://alex.kirk.at/page/131/?output_format=md&term_id=44043)