Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image preloading

    I'm in the process of developing an image preloading script that relies on the .complete property of its Image objects to tell it when to stop running. However, I've found that if bogus filenames are entered, the .complete flag never seems to be set to true. Is there any reliable way (apart from window.onload) to tell when the browser has stopped attempting to load broken images?

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya...

    imgRef.onerror = fp;

    Note: fp means 'function pointer', in case you didn't know.
    Last edited by beetle; 01-15-2003 at 07:14 PM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ...where fp is a function that you previously defined
    Don't resist to assimilation. Billions of Borgs can't be wrong!


  •  

    Posting Permissions

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