TNEW V7 JS loading inconsistent

Working on the templating of our TNEW V7 site and we've encountered a pretty specific problem with script loading orders. On our event listing page, we load a script file that triggers the scripts on $(window).load(function(). The script file loads every time and the console log always indicates that the script fires. However, the script impacts the loaded performance content, and sometimes the script fires after that content is loaded which is correct, but sometimes the script fires before that content loads. It's about 50/50 when it works.

The $(window).load(function() trigger is the only one we could get to work at all, but I guess this inconsistency tells me that the performance information can load after the window. Has anybody experienced and fixed this? Is there a JS trigger that could work?

Parents Reply Children