hackdaddy has asked for the wisdom of the Perl Monks concerning the following question:

After a little experimentation, I have Ajax working and getting XML from a Perl/CGI script at regular intervals with the setInterval JavaScript function. In the JavaScript code, I parse the returned XML and append elements to populate a table at the interval rate.

One of the things I want to do with AJAX is refresh tables at regular intervals like Gmail does. However, I need to track the state of the table on the client side and only send rows from the server that are needed.

I also want to stream log files to the AJAX client at regular intervals.

My question is: How do I keep track of the state of the JavaScript/HMTL I am creating and then get the appropriate xml data from the Apache web server? How does Gmail do this?

Thanks.

Replies are listed 'Best First'.
Re: AJAX, Perl/CGI, Apache, MySQL
by ikegami (Patriarch) on Nov 17, 2005 at 23:17 UTC
Re: AJAX, Perl/CGI, Apache, MySQL
by jZed (Prior) on Nov 17, 2005 at 23:42 UTC
    Ikegami already pointed you at my LiveGrid node. I've greatly souped up the module and am renaming it DBIx::Ajax because it does more than just liveGrids. Unfortunatley I'm off on some travels and won't be able to CPAN the newer version for a couple of weeks. The version on the node should give you an idea though.