have no href at all and just have onClick call a function. In the function have your ajax call. When the ajax call returns the completion event then just use document.location to get the file. If you want to take it one step further you can have the php page that does the db update return a true/false to indicate successful db update. If success then get file, else return error.
On Tue, Sep 15, 2009 at 12:11 PM, Maureen <[email protected]> wrote: > > I guess I'm not explaining myself very well. I know how to do the > call to the javascript and execute the ajax to update the database. > What I am stumped on is how to get the javascript to present the file > for downloading after then ajax call completes. The onclick event of > the button calls the javascript so the code in the a href never fires. > > <a href="loadfile:///?/mid=242"> > <img src="dlbutton.jpg" border="0" width="96" > height="80" onClick="upcount(<?=$thisuser?,<?=$urlvar?>,1)" /></a> > > On Tue, Sep 15, 2009 at 12:48 AM, Dave l <[email protected]> wrote: > > > > would be fairly easy, just take the download link and attach a onclick or > click(depending on straight js or something like jquery) and send a request > out to i guess your php page since js isn't gunna mess with db for you. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:304060 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
