Andy,
I hope you don't mind me butting into the conversation, but I just
caught this thread and took a look at your page. Just a suggestion,
but there is an easier way to accomplish this using JSMX and it
doesn't require the hiding of the div. JSMX is a lightweight
solution for stuff like this. Here's a quick example:
<script type="text/javascript" language="javascript" src="/scripts/
engine.js" ></script>
<script type="text/javascript" language="javascript">
// Display Page
function getData(){
// Set our loader while we're getting the data
document.getElementById("content").innerHTML = "Loading Data...";
http("GET" , "/yourcontent.cfm",write_response);
};
function write_response(data){
document.getElementById("content").innerHTML = data;
};
</script>
<body>
<div id="content"></content>
</body>
That's it. You even create a loading function in your site
javascript and call that before the http() function on any page.
Just a thought,
Jon
On Oct 11, 2006, at 12:16 PM, Andy Matthews wrote:
> That was pretty simple Dan. Doesn't seem to be working correctly
> though. It
> does display the background now, but it doesn't show the loading
> message. I
> suspect this might have more to do with the page structure than
> with the
> code though:
>
> http://www.cfmjet.com/NEWkjwn_nashville.cfm
>
> <!----------------//------
> andy matthews
> web developer
> certified advanced coldfusion programmer
> ICGLink, Inc.
> [EMAIL PROTECTED]
> 615.370.1530 x737
> --------------//--------->
>
> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 11, 2006 9:36 AM
> To: CF-Talk
> Subject: RE: Using CFHTTP, loading bar?
>
>
> Andy,
>
>> On this page:
>> http://www.cfmjet.com/airports.cfm
>>
>> You'll see links to several airports. I'm using CFHTTP to load in
>> data from
>> a site that has detailed information on each of these airports.
>> You'll
>> notice that when you click each of the links, it takes between 10
>> and 20
>> seconds to even show that the page is doing anything, much less
>> display the
>> content.
>>
>> My client is insistent on saying something like "load times may
>> vary" or
>> some other cheesy phrase. I'm wondering if I can go a little
>> further and
>> show some sort of loading bar when each of those links are clicked
>> before
>> displaying the content.
>>
>> I think I might be able to use something like cfflush, but I'm not
>> sure how
>> that would work. Does anyone have any suggestions?
>
> Here's a very basic solution, with just the minimum code. The idea
> is the
> first flush displays part of the content w/ a please wait message
> and then a
> flush is done to push the message to the screen.
>
> Then you do your CFHTTP request and then use JS to hide the layer
> and flush
> again.
>
> The other thing you could do is have the CFHTTP results write to a
> session
> variable or a file and then just relocate the user to a new page
> when the
> CFHTTP request has completed.
>
> <html>
> <body>
>
> <div id="idLoading">
> <div>
> Please Wait...
> </div>
> <div>
> We're are gathering the data for your request.
> </div>
> </div>
>
> <cfflush />
>
> <cfhttp
> ... put your code here...
> ></cfhttp>
>
> <script type="text/javascript">
> document.getElementById("idLoading").style.display = "none";
> </script>
>
> <cfflush />
>
> ..... finish page load ...
>
> </body>
> </html>
>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256367
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4