Using onPageLoad scenarios with asynchronous web content rendering
Separating the page delivery from the web content delivery can increase the page loading time. However, all JavaScript functions that rely on the onPageLoad functions can access only the bootstrapping markup, but not the rendered web content markup. The web content markup is injected into the page as soon as it is ready.
About this task
In some scenarios, custom JavaScript code needs to run
after the asynchronously loaded markup is ready. For such cases, IBM® WebSphere® Portal provides a global
object called wp_wcm_async. This object
becomes available with the wp_wcm_async theme
modules. To register custom functions to different scenarios, you
can use either of the two following two functions:
- To register a function that is called after all asynchronous items on a page are rendered, use addOnPageLoad.
- To register a function that is called after the asynchronous item that is identified by the key is loaded, use addOnAsyncSpotLoad.