I don't know what to make of that Coldfusion code (makes me long for Perl) but what I would do is display the msg div then use $.ajax() to send a request to the server. Use the 'success' callback function to then hide the msg div when your server-side code is done.
On Wed, Oct 14, 2009 at 4:17 PM, Tiger <tigercubs2...@gmail.com> wrote: > > I am running a function that takes a long time to run in coldfusion. > I would like to display a Loading Data message when the data needs to > be loaded then hide that message once the data load is complete. What > jQuery functions do you recommend and what basic approach do I need to > take. > > This is what I have (non qQuery approach), but the cfflush seems to > have issues on the production server. > > > <!--- Load all offices to create a TopOffice org tree. ---> > <cfset application.EmployeeDB_Functions.Loading_Data_Message_On > ('Load_Office','Loading Office Data .........')> > <cfset application.TopOffice = createobject('component','EIMC/ > EmployeeDB/cfc/Office').init(#p_OfficeID#)> > <cfset application.EmployeeDB_Functions.Loading_Data_Message_Off > ('Load_Office')> > > > <!--- Turn ON Loading Data Message ---> > <cffunction name="Loading_Data_Message_On" access="public" > output="yes"> > <cfargument name="FormName" required="yes"> > <cfargument name="Message" required="yes"> > <form name="#FormName#" style="margin:10px;width:600px"> > <input name="inMessage" value="#Message#" style="font-size: > 18px;width:600px"> > </form> > <cfflush> > </cffunction> > > > <!--- Turn OFF Loading Data Message ---> > <cffunction name="Loading_Data_Message_Off" access="public" > output="yes"> > <cfargument name="FormName" required="yes"> > <script> > document.#FormName#.style.height="0px"; > document.#FormName#.style.margin = "0px"; > document.#FormName#.style.visibility="hidden"; > document.#FormName#.style.margin="0px"; > > document.#FormName#.inMessage.value = "Load Complete"; > document.#FormName#.inMessage.style.height="0px"; > document.#FormName#.inMessage.style.margin="0px"; > document.#FormName#.inMessage.style.padding="0px"; > document.#FormName#.inMessage.style.visibility="hidden"; > </script> > <cfflush> > </cffunction> > >