Is there a way to check to see if a page's content is fully loaded?

Discussion in 'Programming' started by SI-Karthis, Jul 23, 2010.

  1. #1
    Hi all, I'm in a bit of a quandary...

    I'm a PHP programmer working on Facebook creating social gaming applications and other scripts for Facebook applications. My latest work preloads all the images on the home page when the user first arrives to my application, and I use Facebook's specialized Ajax to load every page of my app afterward.

    One problem I have is that it can take anywhere from a few seconds to a minute for the application to fully preload all the images for the game depending on their connection speed. Is there any way to check to see if all the content on the page is completely loaded? Or perhaps is there a way to ensure the page loads entirely before it is displayed?

    Being that I work with FBML (Facebook's version of HTML) not everything works the same as it would outside of Facebook on a normal web page, although they are quite similar. I'm hoping someone might be able to provide me with a simple solution or at least one I can modify to work in the Facebook environment.

    If its any help, I preload all my images with CSS (using the style 'display' and setting it to 'none'). FBJS (Facebook's Javascript) doesn't seem to like preloading images via the Javascript function new Image().

    If I can figure out how to make the content wait to be displayed until I tell it to, I'll provide a loading image and progress bar (if possible) to show how far along it is. Thanks for any input! It's times like this I wish I knew flash...
     
    SI-Karthis, Jul 23, 2010 IP
  2. VarriaStudios

    VarriaStudios Member

    Messages:
    246
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    just dispatch an event for any error report , it it gives you an error it means the data wasn't fully loaded.

    regards
     
    VarriaStudios, Jul 23, 2010 IP
  3. SI-Karthis

    SI-Karthis Peon

    Messages:
    102
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Images that didn't load don't give out an error I thought.
     
    SI-Karthis, Jul 23, 2010 IP
  4. newera

    newera Peon

    Messages:
    437
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    they send out an error ... actually its pretty annoying
     
    newera, Jul 23, 2010 IP
  5. SI-Karthis

    SI-Karthis Peon

    Messages:
    102
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok, I'll look into it. I always thought Firebug caught most errors (and it doesn't show up in there).
     
    SI-Karthis, Jul 23, 2010 IP