Link to home
Start Free TrialLog in
Avatar of milestonetech
milestonetech

asked on

Have to simulate Cfquery load times and cfflush isn't working!!! Thoughts?

Hey guys -
I have to build a interactive loading bar to show page loads while various cfquery scripts run.  My goal was to use cfflush to break up the queries and run a javascript to update the loading bar.  For whatever reason, the whole page is just churning and then running all of the code at the end.  Here's my script (nprogress is the loading bar function I'm using, start() starting it, inc() increasing it):

  <script>
    NProgress.start();
 </script>


 BLA BLA
 <cfflush>

 <BR><BR>adfajdlfkajsdflk
<cfquery datasource="MOLMS">
SELECT GETDATE() CurrentTime
WAITFOR DELAY '00:00:05' ---- 5 Second Delay
SELECT GETDATE() CurrentTime 
</cfquery>

 
  <script>

NProgress.inc();
 </script>

 <cfflush>
 
 
 <BR><BR>adfajdlfkajsdflk
<cfquery datasource="MOLMS">
SELECT GETDATE() CurrentTime
WAITFOR DELAY '00:00:05' ---- 5 Second Delay
SELECT GETDATE() CurrentTime 
</cfquery>


  <script>

NProgress.inc();
 </script>

Open in new window


Any thoughts on why cfflush isn't dumping data?  Obviously the queries are fake, but since the time delay is happening on the SQL side, this is more or less the exact way the page would load if it was real data.  


Thanks!!
Avatar of dgrafx
dgrafx
Flag of United States of America image

try putting the following before your script & flush:

<cfoutput>#repeatString(" ", 73729)#</cfoutput>
<script>NProgress.inc();</script>
 <cfflush>
Avatar of milestonetech
milestonetech

ASKER

thanks for the response dgrafx, no luck man....
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points!

I'm hoping this was of value to you and you didn't just accept for general purposes ...

Good Luck!