So forgive if I'm slow to the mark on this ...
when you go to heaped.com ... the browser pauses (showing previous page [i.e. google.com) ... for some 15 (yikes!) seconds, THEN it loads ALL of heaped.com in one swoop.
SO; per your kind info above ... the 15 seconds of CF grabbing google translated api data [based on visitor's location/language], inserting into temp table ... is all done BEFORE the browser even slightly starts to process the 'currently ugly-styled' web page.
Hmm.
If I did a <cfflush> after my header stuff (the menu bar etc) ... would this send / process any HTML up to the point in the page where CFFLUSH is located?
IF SO. ... could I 'simply' insert a jquery BlockUI Plugin call in the HTML/javascript part just BEFORE the <cfflush code ... to display 'wait' message and then do the jquery call at bottom of html/javascripted page to remove 'wait' message?
In other words ... would <CFFLUSH send any HTML/Jscript to the browser before the -pre-HUGE-CF-api-calls- section of CF code- begins?
Forgive is really dumb question.
R
Main Topics
Browse All Topics





by: azadisaryevPosted on 2009-05-20 at 09:26:48ID: 24433627
any CFML code you have is processed by cf server BEFORE it is sent to the web server. non-CFML (html, javascript, etc) code is processed by your web server (or by another corresponding application server like php etc). THEN it is sent to the user's browser.
so your code (which you have not posted any of - "A shed load. www.heaped.com" is surely not all of your code in tat page) which is NOT cfml code will be processed by the web server- it has nothing to do with CF.
one technique that i use with jquery and external code is:
use $.getScript() jquery function to load the external script AFTER the page is rendered. this function has an optional argument you can define a callback function to execute after the external script is loaded - you can use it to call a function that renderes the translated text etc etc etc.
meanwhile, on pageload (and before the external script is loaded) you can set the html of the element where you display translated text (or whatever the outcome of exterant script and callback function is) to show a 'loading' text/anmated .gif image, then, after the script is loaded and your callback function finished processing whatever it needed to processs, replace the html of the element with actual text/html you want to show there.
if you are not too familiar with jQuery's ajax utilities like S.getScript, you might want to look up jquery reference guide: http://api.jquery.com/
(strongly suggest you download the jQuery API AIR application! click on the 'install now' image on the page linked above)
Azadi