SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Thinking...Thinking...Thinking...

    Hello!

    I'm creating pdfs as part of a website. When the user clicks on "Create PDF", a third-party application does the transformation of some html to pdf via php code. The process takes about 10 seconds and I don't want the user to press the submit button more than once. So, I was thinking that I could use a javascript/jquery function to show an alert box while the behind the scene process occurs. While I can use an onclick function to show the initial alert, can I tell via javascript when the process has ended?

    Thank you,

    Eric

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,710
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by kreut View Post
    While I can use an onclick function to show the initial alert, can I tell via javascript when the process has ended?
    It's possible to tell by polling every second to check if the pdf has finished being made.
    Keep in mind though that while the alert is showing, no javascript code gets run in the background.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you! I'll investigate the polling technique and be wary of the alert box.

    -Eric


Bookmarks

Posting Permissions

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