title: Blazor Server App $(document).ready() equivalent
body: <p>I have a Blazor Server app, I need to run a js function when the document is loaded - when I use &quot;Static&quot; mode, jQuery <code>$(document).ready()</code> works fine but I need to use &quot;ServerPrerendered&quot; mode - when user click different link on the navbar, the $(document).ready() never fires because Blazor is using SingalR to update the content. The suggested way to do that is to use <code>JSRuntime.InvokeVoidAsync(&quot;jsfunctiont&quot;)</code> inside
  <code>OnAfterRenderAsync</code> of <code>defaultLayout.razor</code> but the problem is this event happens before all sub-components are fully rendered so my js function will fail.
  My question is what is the way to invoke js function after all sub-components are fully rendered? which is equivalent to <code>$(document).ready()</code> in Blazor server app using &quot;ServerPreRendered&quot; mode?</p>
  <p>Thanks a million!</p>