Re: Continuous communication between user, CGI script and server
- From: Sherm Pendley <spamtrap@xxxxxxxxxxx>
- Date: Wed, 11 Apr 2007 18:32:04 -0400
"robinp.la@xxxxxxxxx" <robinp.la@xxxxxxxxx> writes:
So I have managed to write a CGI script that processes the user's
unputs and then spits back HTML code to the user. Pretty straight
forward. What if I want the user to be able to send data continuously
to my CGI script? Like what if the user drag his mouse around and I
want to process that data every 5 seconds or something. How do I do
that?
Have a look at AJAX. In a nutshell, you have some JavaScript in your page
that periodically looks at the position of the mouse, and submits a request
to your server-side app. Your server-side app will return either XML or
JSON formatted data, which the JavaScript will then use to update the page
by manipulating its DOM.
This is what Google Maps uses, for instance, when you drag a map around in
its viewport.
Not much to do with Perl though. The server side is pretty bog-standard,
aside from returning XML or JSON instead of HTML. The hairy stuff is all on
the client - you should ask about that in a JavaScript group. Or just google
for "AJAX tutorial" to get started.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
.
- Follow-Ups:
- Re: Continuous communication between user, CGI script and server
- From: Scott Bryce
- Re: Continuous communication between user, CGI script and server
- References:
- Continuous communication between user, CGI script and server
- From: robinp.la@xxxxxxxxx
- Continuous communication between user, CGI script and server
- Prev by Date: Continuous communication between user, CGI script and server
- Next by Date: How to interchange a handle and a scalar?
- Previous by thread: Continuous communication between user, CGI script and server
- Next by thread: Re: Continuous communication between user, CGI script and server
- Index(es):
Relevant Pages
|