csierra
Posts: 123
|
Posted: 07/01/2008, 1:49 PM |
|
Hi there, does anyone have an idea regarding how to show an animated gif while running a lenghty script? The problem as we all know is that the page is not processed by the client until it has been served; and if the script runs server side it is done before that happens; I have found this; althought does not work with CSS; it must being done with ASP alone;
<!-- if using Classic ASP: -->
<%
Response.Buffer = true
%>
<!-- if using PHP: -->
<?
ob_start();
?>
<!-- this bit goes at the very top of the page: -->
<div id='interstitial'>
<img src="LoadingAnimation.gif" width="50" height="50" alt="Loading ... Please wait... " />
</div>
<!-- This is for those times where you have to [asp: response.end] [php: exit(); ] for some reason-->
<script language="javascript">
setTimeout('interstitial.style.display="none";',10000);
</script>
<!-- if using Classic ASP: -->
<%
response.flush
%>
<!-- if using PHP: -->
<?
ob_end_flush();
?>
<!--
Insert your entire page contents here, including calls to the database
-->
<!-- this bit goes at the very bottom of the page: -->
<script language="javascript">
interstitial.style.display="none";
</script>
Any help appreciated
_________________
Yes! I Can!!! |
|
|
datadoit
|
Posted: 07/01/2008, 2:08 PM |
|
I've always loaded a 'status' page, which has the animated gif. In the
status page's BeforeShow send to your script page.
In PHP, only the echo command works since it'll display the page with a
pause:
echo "<meta http-equiv='Refresh' content='2; URL=YourPage.php'>";
In ASP I suppose Response.Write (?).
|
|
|
csierra
Posts: 123
|
Posted: 07/01/2008, 2:41 PM |
|
Thanks for your feedback but, no, response.write does not do since it reflects untils the page has been served
_________________
Yes! I Can!!! |
|
|
Oper
Posts: 1195
|
Posted: 07/01/2008, 6:46 PM |
|
Quote csierra:
Thanks for your feedback but, no, response.write does not do since it reflects untils the page has been served
No true, that what people think.
http://www.premiumwebtemplate.com/Premiumwebtemplate/test/ASPTEST.asp
(Take a look)
Also is an ugly way.
AJAX or IFRAME refresh Monitoring are the way
Right now we use SwishMAX (Flash technology)
BTW: Sorry to use that server (no available FTP from here to upload)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
csierra
Posts: 123
|
Posted: 07/01/2008, 8:17 PM |
|
Can you provide the code?
_________________
Yes! I Can!!! |
|
|
Oper
Posts: 1195
|
Posted: 07/02/2008, 7:03 AM |
|
the (for x) is just to create a small delay.
<%
Response.Buffer = false
ZZ=0
for zz=0 to 15
for x=1 to 900000
z=sin(1.45)
Next
response.write zz & "- PRUEBA ASP " & time() & "<BR> "
next
%>
Note: if you do that on one of my Hosting Server i will hunt you down (jaja)
Try the IFRAME monitor method
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
|