<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Dev411 Blog: HTML::Prototype - AJAX Without JavaScript</title>
    <link>http://www.dev411.com/blog/2006/06/05/html-prototype-ajax-without-javascript</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>John Wang on Technology</description>
    <item>
      <title>HTML::Prototype - AJAX Without JavaScript</title>
      <description>&lt;p&gt;&lt;a href="http://search.cpan.org/~esskar/HTML-Prototype-1.45/lib/HTML/Prototype.pm"&gt;HTML::Prototype&lt;/a&gt; is by far the most painless way to get started with AJAX that I've found. Simply put, you do not need to know or write any JavaScript! HTML::Prototype is a Perl module on CPAN that wraps the prototype AJAX library and Script.aculo.us effects library with Perl helper methods so you don't need to write a single line of JavaScript to get some great effects. There are also a number of modules that wrap HTML::Prototype for integration with &lt;a href="http://search.cpan.org/~sri/Catalyst-Plugin-Prototype-1.32/lib/Catalyst/Plugin/Prototype.pm"&gt;Catalyst&lt;/a&gt;, &lt;a href="http://search.cpan.org/~ceeshek/CGI-Application-Plugin-HTMLPrototype-0.20/lib/CGI/Application/Plugin/HTMLPrototype.pm"&gt;CGI::Application&lt;/a&gt;, &lt;a href="http://search.cpan.org/~bauerb/Template-Plugin-HTML-Prototype-0.01/lib/Template/Plugin/HTML/Prototype.pm"&gt;Template Toolkit&lt;/a&gt; and others.&lt;/p&gt;

&lt;p&gt;There are a number of convenient methods such as &lt;span class="fix"&gt;link_to_remote()&lt;/span&gt; and &lt;span class="fix"&gt;submit_to_remote()&lt;/span&gt; that create a link and form button to make an AJAX call and populate the innerHTML of a specified DOM element with the response body. Syntactic sugar to be sure as the JS generated by HTML::Prototype is very simple once you look at it, but the beauty is that you never have to.&lt;/p&gt;

&lt;p&gt;To truly appreciate HTML::Prototype you need to use some of Scriptaculous' more advanced widgets such as autocomplete. Sebastian Riedel put together a screencast using Catalyst that demonstrates how easy it is to use. Links to the screencast are available on the Catalyst wiki movies page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dev.catalyst.perl.org/wiki/Movies"&gt;http://dev.catalyst.perl.org/wiki/Movies&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another great thing about having HTML::Prototype generate the JS syntax for you is that you can learn prototype syntax just by View Source. I picked up enough of prototype's JS syntax this way that I haven't looked at the docs yet.&lt;/p&gt;

&lt;p&gt;I've recently removed HTML::Prototype from a project in favor of using &lt;span class="fix"&gt;prototype.js&lt;/span&gt; and &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; directly and I'm evaluating the Dojo Toolkit but HTML::Prototype let me get started with very effective, painless AJAX functionality. I used it with Catalyst::Plugin::Prototype and thought 'this is how frameworks make you productive.' Thanks to all the contributors.&lt;/p&gt;

</description>
      <pubDate>Mon, 05 Jun 2006 20:52:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:77762545b1dda44d93f114f89f64dfb0</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/06/05/html-prototype-ajax-without-javascript</link>
      <category>catalyst</category>
      <category>perl</category>
      <category>templatetoolkit</category>
      <category>ajax</category>
      <category>scriptaculous</category>
      <category>prototype</category>
    </item>
  </channel>
</rss>
