1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Xenforo callback after page load

Discussion in 'XenForo Development Discussions' started by FootsiesPajamies, Aug 19, 2016.

  1. FootsiesPajamies

    FootsiesPajamies New Member

    Is there any way for a callback to load after the page. Im getting info about a game server and it delays the loading of the entire page, is it possible to load it in after the page is displayed. I tried a few different things but couldnt get it to work.
  2. Mike

    Mike XenForo Developer Staff Member

    You'd probably want to use JS to trigger an ajax request for the data you want to display.
  3. CyberAP

    CyberAP Well-Known Member

    Try triggering async ajax request on DOMContentLoaded event.
    For example a simple get request would look like:
      $(document).on('DOMContentLoaded.loadData', function(evt) {
        $.get('url', function(data) {
          // triggered after data received

Share This Page