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.getEle mentById('someI D');
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%20Lib rary%20Info.htm >
<URL:http://www.sergioperei ra.com/articles/prototype.js.ht ml>
<URL:http://wiki.script.acu lo.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.c om/faq/>