开发者

javascript event for attachment downloaded?

i have a page 开发者_如何学运维that generates a report, the report is sent to the browser as an attachment. what i would like to do is .. disable the generate report button , or show a spinny please wait, and when the attachment has finished being generated and has been sent to the browser i'd like to remove the spinny logo/re-enable the button..

is there a js event like, on attachmentcomplete or some such?

thanks

nat


is there a js event like, on attachmentcomplete or some such?

No. The downloading of files is entirely outside of JavaScript's control.

The only way that comes to mind is having the script that generates the report update some sort of flag (e.g. a temporary file) that you can frequently poll from your page using Ajax. When the script is done generating the data, you would delete the flag.

You'll need to decide if it's worth the effort just for a small UI effect, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜