I display a database (cfdump) with a "download database" button at the top. That'll take you to another page that downloads the database using the table as a file_name. This is done through cfcontent. When I do this, it opens up a new window, so at the end of the CF code, I put some js, window.close(); to get rid of the window. Unfortunately, with cfcontent in the page, the window.close() is ignored. Remove the cfcontent and all is fine.
What is a good way to close this window then? Here's my code: <script language="javascript"> function closeIt(){ window.close(); } </script> <CFQUERY NAME="retrieved_data" DATASOURCE="eatsmart"> SELECT * FROM #url.table# </CFQUERY> <cfsetting showdebugoutput="No"> <cfoutput> <cfheader name="Content-Disposition" value="inline; filename=#url.table#.xls"> </cfoutput> <cfcontent type="application/msexcel"> <cfset column_ar = listToArray(retrieved_data.columnlist)> <table border="1" cellspacing="0" cellpadding="0"> <tr> <cfset column_ar = listToArray(retrieved_data.columnlist)> <cfloop from="1" to="#arrayLen(column_ar)#" index="ii"> <cfset content = column_ar[ii]> <td bgcolor="##CBE4F4"><cfoutput>#content#</cfoutput></td> </cfloop> </tr> <cfoutput query="retrieved_data"> <tr> <cfloop list="#retrieved_data.columnlist#" index="col"> <cfset content = retrieved_data[col][currentRow]> <td>#content#</td> </cfloop> </tr> </cfoutput> </table> <script language="javascript">closeIt();</script> _____________________________ Daniel Kessler College of Health and Human Performance University of Maryland Suite 2387 Valley Drive College Park, MD 20742-2611 Phone: 301-405-2545 http://hhp.umd.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222829 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54