# # 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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI progress information using Javascript
by TedPride (Priest) on Dec 07, 2005 at 10:36 UTC | |
|
Re: CGI progress information using Javascript
by Anonymous Monk on Jul 09, 2006 at 16:04 UTC | |
by Anonymous Monk on Jul 12, 2006 at 16:14 UTC |