Progress bar
The more technology we achieve the less patient people become. If things don't happen instantly, we need to give people a sense of progress. Just seeing that we are making progress makes the waiting more pleasant. There are two ways to use the progress bar. The first is to use it completely on the client side and have it updated based on total duration. We will go with intervals for our first example and have the progress status returned from a remote object in our second example. First, here is the code for the remote object. We will call this object progress.cfc
this time. In a real application, we should rarely use server-scope variables but for demo code this should be fine:
<cfcomponent> <cffunction name="getStatus" returnType="struct" access="remote"> <cfscript> var strRet = {}; var span = 0; var duration = 15; if(!structKeyExists(server,"progress")){ server.progress = now(); } strRet.span = abs(dateDiff...