[Catalyst] html::prototype syntax in new Cat version

Jonathan Rockway jon at jrock.us
Thu Jul 5 00:33:09 GMT 2007


On Thursday 28 June 2007 07:33:57 am vb wrote:
> > HTML::Prototype is the Matt's Script Archive of javascript.
>
> possible, but don't confuse with " prototype.js".

Same difference.  The Prototype + Scriptaculous javascript framework is junk.  
It doesn't work very well, the syntax is terrible, it will break other 
javascript on the page just by being included, and the "cool effects" it 
includes aren't even very good.  There is absolutely no reason to use 
Prototype.

Mochikit, Dojo, Mootools, Jquery, etc. will treat you much better.  (I like 
Jemplate also, but that's not a "framework" per-se'.)

> A solution: use "prototype.js" as is, and not from HTML::Prototype!

This is the right idea.  Put your javascript in .js files, include those in 
the page, etc.  Catalyst/Perl doesn't need to deal with your Javascript.  
Just treat it as static content (the library) or HTML (hooks in the 
document).

If you want AJAX stuff, I recommend building a JSON/REST interface with 
Catalyst::Action::REST and using one of the above frameworks to talk to it.  
With Jemplate, you can render your TT templates client-side, which is always 
fun.

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part.
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070704/42ba327e/attachment.pgp


More information about the Catalyst mailing list