Re: prototype.js (was Re: Ajax Timeouts)



Tony wrote:
Matt Kruse wrote:
Chaprasi wrote:

Hi I need help with prototype while doing ajax calls. So this is my
JS which does a ajax calls


Prototype.js is generally avoided by most people in this group.
You won't find much help for it here.

I haven't really looked at prototype.js - would you mind sharing why it's generally avoided?

In no particular order:

1. It modifies the protoype of some built-in objects so that
using say, for..in with an array object produces unexpected results.


2. It requires a different syntax, so that instead of using say:

var el = document.getElementById('someID');

you use:

var el = $('someID');

Instead of looping through a number of IDs, you'd use:

var els = $('someID_01', 'someID_02', elRef_03);


3. Having used and become dependent on its syntax, you'll
have to learn 'real' JavaScript at some point.


4. It is utterly undocumented by the author and only very
sparsely commented. Some other attempts at documentation:

<URL:http://blogs.ebusiness-apps.com/jordan/pages/Prototype%20Library%20Info.htm>
<URL:http://www.sergiopereira.com/articles/prototype.js.html>
<URL:http://wiki.script.aculo.us/scriptaculous/show/Prototype>
<URL:http://www.snook.ca/archives/000531.php>


5. There is no support community or blog of any real substance


6. It has about 2,0000 lines of code when only a small subset
might be needed. It is not easy to use only portions,
as many functions are reliant on others. Those dependencies
are not documented.


7. Its feature detection is sparse and it is likely to fail in
many browsers with no chance of recovery


8. It encourages bad coding practice with functions like:

Try.these( func01(...), func02(...), func03(...) );

as a shortcut for multiple try..catch blocks and replacement
for feature detection.

And so on...


--
Rob
Group FAQ: <URL:http://www.jibbering.com/faq/>
.



Relevant Pages

  • Re: [dm-devel] REQUEST for new topology metrics to be moved out of the queue sysfs directory.
    ... which knob to choose is I/O size dependent. ... it I can use the documentation to verify the implementation (in md at ... match the documented meaning I might even be ...
    (Linux-Kernel)
  • Re: Whats the point of Windows.Forms.Timer?
    ... >recommend reading the documentation for SetTimer and KillTimer. ... >Windows handles the creation of the message in this case, ... >resource issue here since each timer creates a little bit more overhead in the ... >dependent on background threads, the thread pool, and possibly marshalling the ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: looking for good mod_perl documentation -- desperate, out of options
    ... ability to feed themselves and their family was dependent on their ... ability to produce documentation that actually worked, and, if they ... had published something consisting of the contents of the URL above, ... Has any documentation ever been written for mod_perl that comes out ...
    (comp.lang.perl.modules)
  • Re: Newbie: formatting numbers
    ... >However as I said i was hoping for something simple and not dependent on ... >regional settings. ... >Do i have to read all this documentation? ...
    (microsoft.public.dotnet.languages.vb)