detecting when the “File download” popup is closed

后端 未结 5 1731
情书的邮戳
情书的邮戳 2020-11-28 11:53

I have a web page (made with JSF) where some links allow the user to get a PDF file.

When the user clicks on such a link, a waiting popup (it is a modal panel) is di

5条回答
  •  [愿得一人]
    2020-11-28 12:36

    No such event exists. You need to take a different approach to solve this.

    1. target the download link to a hidden iframe with a name (target="myhiddeniframe")
    2. on click of the download link, show your loading spinner
    3. set the onload attribute of the iframe to a callback that hides your spinner

    Net effect: you "spin" while the pdf is generated, and "unspin" when the "File download" dialog appears (as opposed to when the "File download" dialog is closed).

提交回复
热议问题