DISCUSS: CPAN Namespace for AJAX

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a module that is ready for release, it just needs a (better)
name.  The working title has been "Pail" (Perl/Ajax Implementation
Layer) but that does not fill me with joy, as it is utterly opaque.

I have noticed that there appear to be *no* AJAX related modules in
CPAN (which I find difficult to believe), and the only module I have
found OUTSIDE of CPAN was Sajax.pm which is pretty deficient (not
using the "X" in AJAX being at the top of the list.)

Some ideas that I have had:

1)  HTTP::AJAX::Pail

Keeps the "cutesy" name, but puts it into a namespace where it will at
least invite reading.

2)  HTTP::AJAX::Class

My module is an object-oriented base-class, and as such deserves a
highly generic name.  (Although it has two variants, one that provides
XML marshalling for return values, and one that allows arbitrary text

A little detail about the functionality:

On the server side, you write a class

package My::Class;
use base 'HTTP::AJAX::Pail';

sub get_record {
  my ($self, $paramhash) = @_ ;
  return undef unless exists $paramhash->;
  my $message = do_something($paramhash->);
  return ( { record_num => $paramhash-> ,
             record_text => $message } );


In your javascript you do something roughly like:

   <script src="http://server/ajax-port.cgi?method=javascript">


   function Completion_function(r) {
     var xml = r.responseXML;
     ... do something with the XML ...

   function get_detail(record_num) {
     var r = new My_Class;
     r.some_method( Completion_function, { 'record_num' : record_num } );


There are some other details I'm glossing over right now, because they
seem to be outside the scope of the "What do I *CALL* this thing?"

FYI (because you're dying to know) - the method=javascript is a
'magical' method that walks your derived class's symbol table, and
creates a javascript class, 'My_Class' with stub routines to build the
AJAX request and fire it off.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer  software  consists of  only  two  components: ones  and
zeros, in roughly equal proportions.   All that is required is to
sort them into the correct order.

Re: DISCUSS: CPAN Namespace for AJAX

Quoted text here. Click to load it

Just on this one: Look for HTML::Prototype :)

greets, phay

thou shallst fear ..

Re: DISCUSS: CPAN Namespace for AJAX

On Thu, 4 Aug 2005 05:58:13 +1000, Robert Sedlacek wrote:

Hi Folks

Well, actually it's JavaScript::RPC::Server::CGI you want, even though the name
is /not/ buzz-word-compliant ;-0.

Re: DISCUSS: CPAN Namespace for AJAX

Quoted text here. Click to load it

What are you replying to? I was trying to say that there *is* already an
AJAX module, named HTML::Prototype.


btw: Your lines seem a bit long.

sapere aude.

Site Timeline