CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: IE can't count?

  1. #1
    Join Date
    Jan 2002
    Location
    Right here.
    Posts
    150

    IE can't count?

    Hello,


    Do we have ANY control over how the browser obtains it's data from the HTML source?

    What order it dowloads images in, or how long to wait between downloads from the HTML? Or how about any error catching when it's not able to get an image - like telling it to try another location or wait a while and try again?

    For example, I have a web page that have 20 more images on it. I want them to load in a particular order, with a given amount of buffer time in between each load. If it has trouble obtaining any of them, it checks somewhere else for the image.

    Is this possible?

  2. #2
    Join Date
    Jan 2003
    Location
    Manchester, England
    Posts
    11
    Just guessing but have you tried to set the source using MyImage.src = "xxxx.xx" ? If this works then you could use setTimeout() to stagger the loading of the images. I think you can then check the status of MyImage.complete, if it is true then it loaded ok.

  3. #3
    Join Date
    Jan 2002
    Location
    Right here.
    Posts
    150
    There is a complete() function on the Image control? I can't find any documentation on it; but that sure would be handy. Does it return false if the image is not found and it places a red X instead?

    Do you happen to know where I can find some good documentation on that? I do a search on yahoo/google for "javascript complete" and I get everything except for what i'm looking for.

  4. #4
    Join Date
    Aug 2002
    Location
    Reykjavik, Iceland
    Posts
    201
    Correct. On an image object, you can read the complete property to see if an image load is complete. This boolean property will return either a true or false.

    if (document.images['myimage'].complete == false) {
    // the image didn't load for some reason
    }

    Note that this is a property, not a method, so you do not include parenthesis ()

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured