www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Check ending page load in a special case

  1. #1
    Join Date
    Sep 2010
    Posts
    2

    resolved [RESOLVED] Check ending page load in a special case

    Hi all!

    I'm having some troubles trying to know the end of a page load in a very particular case. Here it is :

    1) page is loaded
    2) it has a button : "Print PDF"
    3) when click on it, the following code is executed:
    Code:
    window.location.href = "printpdf.php";
    4) the php page returns the pdf, asking for download (or open with), so headers are set to "Content-type: application/pdf"

    Is it possible to know when the popup "download / open with" appears? I tried to put a "window.onload=function(){alert('hi');}" just before the location.href, but nothing happens.

    What I would like to do is to display a "please wait" after clicking the button, and remove it when the pdf is generated. Is there a solution or may I search a totally other way to do it? (The full reload of the page is not an option, unfortunately)

    Thanks!
    rekam

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    No, or at least not easily. That kind of stuff is really outside of JavaScript's remit.
    Great wit and madness are near allied, and fine a line their bounds divide.

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Ok, thanks. So I will search in an other way. Maybe by generating the pdf to the server, and then link on it... Or I say byebye to the "please wait" ^^

    Anyway, thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles