in reply to displaying a screen while waiting for some computation
This re: could be a little off-topic, sorry about that, but maybe you could give Ajax a try. This is a very simple example of usage, surely you could find nice tutorials on the web
The html:
<html> <head> <title> ajax_app.html </title> </head> <body> <script> function xmlhttpPost(strURL){ var xmlHttpReq = false; var self = this; if (window.XMLHttpRequest){ /* XHR no IE */ self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject){ self.xmlHttpReq = new ActiveXObject ("Microsoft.XMLHTTP"); } self.xmlHttpReq.open ("POST",strURL,true); self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www- +form-urlencoded'); self.xmlHttpReq.onreadystatechange = function () { if (self.xmlHttpReq.readyState > 0 && self.xmlHttpReq.readyState < 4) { updatePage ("<p>Please wait while processing...</p>") } if (self.xmlHttpReq.readyState == 4) { updatePage ("<p>result is: </p>" + self.xmlHttpReq.responseTe +xt); } } self.xmlHttpReq.send("data=kk"); } function updatePage (str){ document.getElementById("res").innerHTML = str; } </script> <form> <input value="Enviar" type="button" onclick='JavaScript:xmlhttpPost("/cgi-bin/proc.pl")>Click me</input> <div id="res" ></div> </form> </body> </html>
The cgi:
#!/usr/bin/perl use strict; use warnings; use CGI; sleep(2); my $q = new CGI; my $p = $q->param("data"); print $q->header; print $q->p($p);
The idea is to don't change the page while the cgi is doing its job
Hope this helps
citromatik
|
|---|