Is there a way to detect the start of a download in JavaScript?

后端 未结 3 980
抹茶落季
抹茶落季 2021-01-13 10:48

In our current project we are providing a PDF download that can be customized by the user through an HTML form he submits. It takes several seconds to dynamically generate t

3条回答
  •  自闭症患者
    2021-01-13 11:13

    The simplest solution would be to estimate the time (generously) and do it that way. It's a hack, but it gives the desired effect. The other option might be to submit the form with a callback using Ajax to submit the form and have the generator return details to the calling page. http://www.jquery.com/ might be a good place to start for that option.

提交回复
热议问题