# # If Javascript is disabled in the browser, the effect # should be that no status line will appear, but # everything will still work. This is important! # # Call makestatusline near the start of execution, just # after outputting the HTTP header or soon after so that # the status line will appear ner the top of the page # sub makestatusline { print <<"EOT" ; <script language="JavaScript1.2"><!-- if (document.getElementById || document.all || document.layers) document.write("<div id=statusbox><p>Status: </p></div>"); function newstatus(s) { var e; if (document.getElementById) { e = document.getElementById("statusbox"); } else if (document.all) { e = document.all["statusbox"]; } else if (document.layers) { e = document.layers["statusbox"]; } e.innerHTML = "<p>Status: " + s + "</p>"; } //--></script> EOT } # # Now call this function once in a while when you have # something to say to the user. Just make sure you don't # call it while you are in the middle of outputting an # HTML tag (finish the tag first, then call it) # # INPUT: a string, to display in the status line sub newstatus { my ($s) = @_; $| = 1; print <<"EOT" ; <script language="JavaScript1.2"><!-- newstatus("$s"); //--></script> EOT }
In reply to CGI progress information using Javascript by Celada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |