SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to check if file download is complete?

    Hi

    I am trying to build a script, where the file references get added to an array when downloaded.
    I have a slideshow so I want it the image references to be dynamically added to the javascript array. Any ideas how to do this? Is there an event which returns true when download complete?

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Koora View Post
    Hi

    I am trying to build a script, where the file references get added to an array when downloaded.
    I have a slideshow so I want it the image references to be dynamically added to the javascript array. Any ideas how to do this? Is there an event which returns true when download complete?
    You could attach an onload handler to each Image object/placeholder depending on how your code is structured:

    Code:
    imgObj.onload = function(){ myArray.push( this.src ); }
    Tab-indentation is a crime against humanity.


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
  •