After I call the server to get a file, how can I call a javascript function when the dialog for download is shown?
EDIT: My goal is to give the client a feedback when the file is being processed by the server, so events like onclick will not do.
After I call the server to get a file, how can I call a javascript function when the dialog for download is shown?
EDIT: My goal is to give the client a feedback when the file is being processed by the server, so events like onclick will not do.
Not sure what you are using exactly...
But one of the things you can try is an AJAX based framework like DWR for this.
Basically, you make a call to the server which does some processing and returns control back to client. Now at the client side, you can use callback functions that get called after the server has finished execution.
You can execute JavaScript when event occurs, full list of event attributes you can find here:
http://www.w3schools.com/jsref/dom_obj_event.asp
Unfortunately, you don't have event of showing download dialog.
Instead, you can use for example onclick="jsFunction()"
with download links.