Hi @jeffgreenrc ,
Usually, this is the order of sequence. I don't think there is documentation yet. But sharing based on what we have experienced so far.
1. If the page has an entity list.
| Order sequence |
JS execution |
| 1. |
Web Template / Page Template contains JS |
| 2. |
Entity list |
| 3. |
Page |
2. If the Page has Entity form (Basic / Advanced Form)
| Order sequence |
JS execution |
| 1. |
Web Template / Page Template contains JS |
| 2. |
Entity Form |
| 3. |
Page |
For your second question, I am adding the official reference where it contains sample jQuery execution
https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript
You can find how the jQuery sequence is utilized. Adding few more
1. Entity form on load
2. Entity List on load
The above two methods should be wrapped under $(document).ready.
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.