I need this kind of event for the following purpose:
1 considering a standard html-form (no ajax)开发者_Go百科 2. user submits the form - expecting a pdf 3.1 request takes a while (> 2min) 3.2 user should see a spinner o.s., while the request is processing 4. spinner should disappear, when download-dialog pops up (need event here)
If there's no AJAX involved, $(document).ready(...)
...since the page is reloaded completely (this is standard browser behavior).
Also, if the destination is a PDF, there will be no JavaScript on the other side anyway :)
You should make an ajax request for this, otherwise it's not really gonna work. You could consider putting the generation in a background job and email the ppl once a request is finished.
Keep in mind that a request that takes that long will in most cases fire a timeout.
精彩评论