Javascript Ajax loaded event?

jfriendjfriend Registered Users Posts: 8,097 Major grins
I'm trying to add some Javascript to my customizations that will modify some things on a gallery page. If I hook the body onLoad event and run my JS there, I find that the Ajaxified page isn't there yet (there are no gallery images in the DOM yet). Is there an event that I can hook into so my JS gets called after the Ajaxified page is created?
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 15, 2008
    jfriend wrote:
    I'm trying to add some Javascript to my customizations that will modify some things on a gallery page. If I hook the body onLoad event and run my JS there, I find that the Ajaxified page isn't there yet (there are no gallery images in the DOM yet). Is there an event that I can hook into so my JS gets called after the Ajaxified page is created?

    OK, I found that I can subscribe to onPhotoShow and get notified everytime a new image is displayed, but unfortunately the page is not fully formed when onPhotoShow is called. Apparently, some of the navigation elements are not updated until after onPhotoShow is called. For example, the function drawPhotoNav which creates a few of the navigation elements is called after onPhotoShow. This is messing up what I'm trying to do.

    Is there any straightforward way to get notified each time a new image is displayed after the page is fully formed (e.g. when Smugmug JS code is done modifying the DOM)?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.