Is there an event when comments are done being loaded?

jfriendjfriend Registered Users Posts: 8,097 Major grins
A customer has asked for some javascript that would modify text in some comment headers, but the comments are dynamically loaded so I need some sort of event when the comments are done loading so I can fire the script. Are there any events when comments are done loading? If not, can there be one added?

FYI, all dynamically added things in the page should have an event so JS can be triggered then. It would be one or two lines of code for each item and would massively enable and simplify certain types of JS customizations. This includes comments, lightbox, photobar, all buttons inserted via JS, etc... It would not be hard to just make a contract that every dynamically added thing in the page would fire an event with the object name when it was done being 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

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 19, 2010
    Hey John,

    yes, it would be nice to have more custom events that JS could subscribe to.

    Have you tried ?
    YE.onContentReady('comments', function() {});
    

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited October 19, 2010
    devbobo wrote: »
    Hey John,

    yes, it would be nice to have more custom events that JS could subscribe to.

    Have you tried ?
    YE.onContentReady('comments', function() {});
    
    Cheers,

    David
    Yes, it fired, but the rest of the comments weren't there yet.
    --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.