Sequential execution of onload events

If there are 2 onload events on a page. Will the task execute sequentially?

2 Likes

Tasks for one taskgroup will be executed sequentially.
But, if there are 2 or more onload events on the same page the sequence may vary in some cases:

  1. When the taskgroup contains more number of tasks.
    For instance, if Event1 consists of 100 tasks and Event2 consists of 2 tasks. The 100 tasks will start executing in a sequence. But event 2 will start executing whenever the entity on which the event is mapped loads on the page. This will overlap the tasks of both the events
  2. Event contains API task which takes some time to get the response.
15 Likes