Setting a timer after page is finished loading

3 posts, 0 answers
  1. Tony
    Tony avatar
    5 posts
    Member since:
    Apr 2008

    Posted 25 Mar 2010 Link to this post

    I have a site that loads data intensive charts that take a while to generate.  In order to improve the user's experience, we opted to load the page (minus the charts), then fire an ajax call to begin loading the charts at that time.  Currently it is simply being done by a Timer whose Interval is set to 1 sec.

    This works responsibly well on most machines.  However, we started having some errors where splitters would not resize initially, menus would not load completely etc.  For the most part the behaviour was random and worse on some machines.

    I realized that the JS was not completly loading before the timer was kicking off.  The timer was killing the current runing js files.

    So I changed the timer to a 5 sec delay and everything worked as adversied.

    So my question is: Is there an event that gets fired once all of the Telerik JS is finished loading?  If I could tie into that, I could enable my timer at eliminate the generic 5 sec wait time for most users.

    Thanks for any advice.
    Tony
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 25 Mar 2010 Link to this post

    I think you should handle the jQuery load event and then execute your timer. Like so:

    $(window).load(new function() { startTime();});

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. SamJ
    SamJ avatar
    101 posts
    Member since:
    Jul 2008

    Posted 28 Mar 2010 Link to this post

    Hi Tony,

    You can hook up the pageLoad client-side event which is fired after the page is fully loaded and all client-side objects of the controls are finished initializing.

    Check the below articles:
    http://www.telerik.com/help/aspnet-ajax/ajxshowloadingpaneloninitialpageload.html
    http://blogs.telerik.com/dimodimov/posts/08-12-13/don_t_use_body_onload_in_asp_net_ajax_websites.aspx

    I hope this helps.

    SamJ
Back to Top