maybe a better approach would be to add <cfset ajaxonload('name-of-js-function-to-execute')> at the bottom of the page loaded in your cfwindow instance.
this way it is guaranteed to run after the cfwindow content is loaded - setTimeout() will delay code execution, but does not guarantee that the code runs after the content is loaded (i.e. due to delay because of network congestion, etc). the downside of using ajaxonload() cf function is - it does not accept any parameters, so you can't pass arguments to the js function it is set to execute. Azadi On Tue, Dec 4, 2012 at 3:44 AM, James Steubing <ja...@steubing.net> wrote: > > > > I am incorporating CFWindow and coldfusion.window functions into my > > site and have them working very well except for one issue. I would > > like to execute some javascript after the cfwindow fully opens but > > everything I am doing appears to execute after the popup appears but > > before the coldfusion page loads into the window. > > > > I have tried ajaxonload(), javascript onload, $('#docload'). > > ready(function(), etc. > > > > They all seem to execute before the actual end of the process. > > > > Is there a way around this? Any help on this would be greatly > > appreciated. > > I solved the problem by using setTimeout(function(){ insert_javascript_here > },0); from within the page I was loading in the popup. Calling an external > function was executing at the wrong time, but using setTimeout like this with > a timeout of 0 milliseconds works like I needed it to. Hope this helps > someone someday. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353360 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm