I think there is a bit of confusion here as to how Coldfusion works.
By default the Coldfusion server will return the generated HTML all at
once. So if you have a long query your not going to get even the first
bit of the document until the CF server is done with it. What your
asking your .js to do is when the page begins to load show a loading
image and when it's done hide it. Well Coldfusion will give your the
entire document at once, even if there is a huge grid with data in it
you get all of it at once after CF is done creating it and chances are
if you have a fast connection even if the document weight is up there
your not going to get the behavior your looking for.

The reason it works with your images is because they take a bit longer
to download and they download after the document has been served from
the CF server. The markup returned from the server tells the browser
where to load the images from. What you need to do is have the CF
server stream the document to you as it generates it. This can be done
using the cflush tag.

http://cfquickdocs.com/cf8/?getDoc=cf#cfflush

if you use this properly you can start sending the headers and stuff
to the client browser right away and your .js being in the head of the
document should execute as well.

The other trick would be to use AJAX to load your query result and
inject it into the page or pass it to some data handling .js. With
AJAX you can use the events that fire before the request begins and
after it completes to toggle a neat-o loading image.

HTH






On Oct 21, 8:17 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote:
> Mike!  Crawl back under your rock, you fathead!!!
>
> There...how's that? :o)
>
> Rick
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of Mike Alsup
> Sent: Wednesday, October 21, 2009 7:51 PM
> To: jQuery (English)
> Subject: [jQuery] Re: loading message shows up after page has loaded
>
> > Hope that helps.
>
> > --Karl
>
> Bah, this is getting entirely too civil.  Snooze...  :-)

Reply via email to