[ ]
"Please Wait" (bitte warten) Hinweise sind eine gute Möglichkeit, Ihre Besucher darauf aufmerksam zu machen, dass
Ihre webbasierte Applikation momentan eine Berechnung durchführt oder eine Seite lädt. Ohne diesen Hinweis beginnen Benutzer
möglicherweise damit, die Seite zu reloaden, weil Sie denken, der Browser würde hängen.
Ein Klick auf den Button simuliert eine Verarbeitung und zeigt die "Please Wait" Nachricht an.
[ ]
[ zwischen <BODY> und </BODY>]
<!-- Original: Joseph McLaughlin (joe.mclaughlin@comcast.net) -->
<!-- Web Site: http://solutionenterprises.com -->
<script language="javascript">
function do_totals1()
{
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout('do_totals2()',1);
}
function do_totals2()
{
lengthy_calculation();
document.all.pleasewaitScreen.style.visibility="hidden";
}
function lengthy_calculation()
{
var x,y
for(x=0;x<1000000;x++)
{
y += (x * y) / (y - x);
}
}
</script>
<DIV ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;top:30%;left:42%;visibility:hidden">
<TABLE BGCOLOR="#000000" BORDER="1" BORDERCOLOR="#000000" CELLPADDING="0" CELLSPACING="0" HEIGHT="100" WIDTH="150" ID="Table1">
<TR>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="silver" ALIGN="CENTER" VALIGN="MIDDLE">
<FONT FACE="Arial" SIZE="4" COLOR="blue"><B>Calculating<br>
Please Wait</B></FONT>
</TD>
</TR>
</TABLE>
</DIV>
<P align="center">
"Please Wait" messages are an excellent way to let the user know that your web
based application is performing some action, such as loading a page or
processing data. Without such a notification, users may begin clicking other
controls on the web page, or close the browser due to the excessive delays.
</P>
<p align="center">
Pressing the button below will simulate a lengthy function or calculation.
While the function is calculating, a "Please Wait" message will be displayed.
This is done using a DIV area. When the function begins the DIV area is shown
and when the function ends, the DIV area is hidden.
</p>
</p>
<p align="center">
<input type="button" name="btn_calc" value="Perform Calculation" onclick="do_totals1()">
</p>
[ ]
Joseph McLaughlin
[ ]
Kopieren Sie bitte den Code