Asynchronous cgi that returns nothing. Possible? O:-)

Steve Holden sholden at holdenweb.com
Wed Apr 24 08:41:03 EDT 2002


"Jon Ribbens" <jon+usenet at unequivocal.co.uk> wrote in message
news:slrnacctn8.s1r.jon+usenet at snowy.squish.net...
> In article <3umccu09j6dkui67hnppulv8ngk71g55s4 at 4ax.com>, Fernando
Rodríguez wrote:
> >> If they really must be separate scripts, why doesn't script (a)
> >> just output nothing at all to stdout?
> >
> > I didn't try it, but I think the browser wouldn't like a cgi url that
doesn't
> > return any html content, no? O:-)
>
> I thought they were running on the same machine, in which case the
> entire sequence of [run script a + run script b] would produce the
> correct CGI output.
>
> You are going to have to do as someone else suggested, use the Python
> standard library routines to issue another https request yourself from
> the server to run script (b).

You *could* use some clever client-side Javascript so that an onClick()
event on the form's submit button (or some other suitable GUI element) calls
a procedure that targets script (a) into an invisible frame and then submits
the form that triggers script (b) targeted into the main window.

Generally, browsers don't like null outputs, and some will complain visibly.
Using this scheme, however, script (a) can send a well-formed HTML response
that the user will never see. You could even include some more clever
Javascript in *that*, if you wanted, to check the output from script (b) as
it came in. Yawn.

tired-of-working-round-web-inadequacies-ly y'rs  - steve
--

home: http://www.holdenweb.com/
Python Web Programming:
http://pydish.holdenweb.com/pwp/








More information about the Python-list mailing list