Javascript that is the last thing to run on a page?

I am still spinning up in SKUID so I apologize in advance if I am not using the right terminology :slight_smile: . We have a problem when loading a page in that the focus is going to a control way down the page. There is javascript that will scroll to the top of the page - is there a straight forward way in SKUID to add this javascript to a SKUID page so it is the very last thing to run (so when the page is done loading the user is at the top of the page)?

Have you tried running your code in theย $( document ).ready() event?

Or, you can try this:

(function(skuid) {&nbsp; &nbsp; var $ = skuid.$;<br>&nbsp; &nbsp; $('.nx-page').one('pageload', function() {<br>&nbsp; &nbsp; &nbsp; &nbsp; // your code goes here<br>&nbsp; &nbsp; }); <br>})(skuid);